Convert Timer IO
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
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 auto Mode = CounterMode_t::from(CounterMode_t::FreeRun, Counter2_v::SyncMode::FreeRun, CounterMode_t::ResetAfterTarget, CounterMode_t::IRQAtTarget, CounterMode_t::IRQEveryTime, CounterMode_t::IRQPulse, Counter2_v::Source::System_Clock_Div_8);
|
||||
|
||||
Interrupt::disable_irq(Interrupt::Timer2);
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
__syscall_SysEnqIntRP(Timer2Irq, &IRQCallback);
|
||||
__syscall_ExitCriticalSection();
|
||||
|
||||
Counter2.target.write(CounterTarget::CounterTargetValue.with(HighResTime::TicksFor10ms));
|
||||
Counter2.mode.write({Mode});
|
||||
Counter2.set_target_value(HighResTime::TicksFor10ms);
|
||||
Counter2.set_mode(Mode);
|
||||
|
||||
Interrupt::enable_irq(Interrupt::Timer2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user