Cleanup code
This commit is contained in:
@@ -31,16 +31,14 @@ namespace JabyEngine {
|
||||
static constexpr auto Mode = CounterMode::with(CounterMode::FreeRun, Counter2::SyncMode::Freerun, CounterMode::ResetAfterTarget, CounterMode::IRQAtTarget, CounterMode::IRQEveryTime, CounterMode::IRQPulse, Counter2::Source::System_Clock_Div_8);
|
||||
static constexpr uint16_t Target = MS_Per_Tick<uint16_t>(CPU_Frequncey_Hz_Div8)*10;
|
||||
|
||||
printf("Timer2 Target: %i\n", Target);
|
||||
|
||||
Interrupt::disable_irq(Interrupt::Timer2);
|
||||
|
||||
__syscall_EnterCriticalSection();
|
||||
__syscall_SysEnqIntRP(Timer2Irq, &IRQCallback);
|
||||
__syscall_ExitCriticalSection();
|
||||
|
||||
Counter[2].target.write(CounterTarget::CounterTargetValue.with(Target));
|
||||
Counter[2].mode.write(Mode);
|
||||
Counter2::Timer.target.write(CounterTarget::CounterTargetValue.with(Target));
|
||||
Counter2::Timer.mode.write(Mode);
|
||||
|
||||
Interrupt::enable_irq(Interrupt::Timer2);
|
||||
}
|
||||
|
@@ -20,10 +20,12 @@ namespace JabyEngine {
|
||||
}
|
||||
|
||||
uint32_t interrupt_handler(uint32_t) {
|
||||
GlobalTime::global_counter++;
|
||||
GlobalTime::global_counter = GlobalTime::global_counter + 1;
|
||||
|
||||
Interrupt::ack_irg(Interrupt::Timer2);
|
||||
__syscall_ReturnFromException();
|
||||
// v to make GCC happy
|
||||
return 0;
|
||||
}
|
||||
|
||||
InterrupCallback IRQCallback = {
|
||||
|
Reference in New Issue
Block a user