The timer has a lot of parts making it clunky to use. Ideally it should be more like:
static TIMER: AtomicOnceCell<Timer> = AtomicOnceCell::new();
#[task(priority = 1)]
async fn task() {
let timer = TIMER.get().unwrap().clone();
loop {
// [...]
}
}
fn main() {
let countdown = impl_countdown_of_choice();
let task1 = task1_fn();
let executor = static_executor!(countdown, task1);
TIMER.set(executor.get_timer()).unwrap();
// [...]
}
The timer has a lot of parts making it clunky to use. Ideally it should be more like: