public SunxiTimer(Machine machine) { timers = new SunxiTimerUnit[NumberOfTimerUnits]; for (int i = 0; i < NumberOfTimerUnits; ++i) { int j = i; timers[i] = new SunxiTimerUnit(machine, this); timers[i].LimitReached += () => OnTimerLimitReached(j); } timerInterruptEnabled = new IFlagRegisterField[NumberOfTimerUnits]; timerInterruptStatus = new IFlagRegisterField[NumberOfTimerUnits]; Timer0Irq = new GPIO(); Timer1Irq = new GPIO(); SetupRegisters(); }
public SunxiTimer(Machine machine) { timers = new SunxiTimerUnit[NumberOfTimerUnits]; for(int i = 0; i < NumberOfTimerUnits; ++i) { int j = i; timers[i] = new SunxiTimerUnit(machine, this); timers[i].LimitReached += () => OnTimerLimitReached(j); timers[i].EventEnabled = true; } timerInterruptEnabled = new IFlagRegisterField[NumberOfTimerUnits]; timerInterruptStatus = new IFlagRegisterField[NumberOfTimerUnits]; Timer0Irq = new GPIO(); Timer1Irq = new GPIO(); SetupRegisters(); }