Improve struct and namespace usage
This commit is contained in:
@@ -28,6 +28,8 @@ namespace JabyEngine {
|
||||
}
|
||||
|
||||
void setup() {
|
||||
using namespace Timer_IO;
|
||||
|
||||
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;
|
||||
|
||||
@@ -37,8 +39,8 @@ namespace JabyEngine {
|
||||
__syscall_SysEnqIntRP(Timer2Irq, &IRQCallback);
|
||||
__syscall_ExitCriticalSection();
|
||||
|
||||
Counter2::Timer.target.write(CounterTarget::CounterTargetValue.with(Target));
|
||||
Counter2::Timer.mode.write(Mode);
|
||||
Counter2.target.write(CounterTarget::CounterTargetValue.with(Target));
|
||||
Counter2.mode.write(Mode);
|
||||
|
||||
Interrupt::enable_irq(Interrupt::Timer2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user