-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Description
I really just want something like
let _ = tim6.repeat(1000, Priority::P1 || {
// toggle the led
let current_state = led.get();
led.set(!current_state);
});instead of
tim6.sr.update(|sr| sr.set_uif(false));
// setup timing
tim6.psc.update(|psc| psc.set_psc(42000));
tim6.arr.update(|arr| arr.set_arr(3000));
// enable interrupt
tim6.dier.update(|dier| dier.set_uie(true));
// start the timer counter
tim6.cr1.update(|cr1| cr1.set_cen(true));
let _ = interrupt_table.register(InterruptRequest::Tim6Dac, Priority::P1, || {
// toggle the led
let current_state = led.get();
led.set(!current_state);
// make sure the interrupt doesn't just restart again by clearing the flag
tim6.sr.update(|sr| sr.set_uif(false));
});