Skip to content

Commit

Permalink
Make sure the scheduling won't start before everything is setup (esp-…
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed May 23, 2024
1 parent dc5501b commit 5d91b1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions esp-wifi/src/timer/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ const TIMER_DELAY: fugit::HertzU32 = fugit::HertzU32::from_raw(crate::CONFIG.tic
static ALARM0: Mutex<RefCell<Option<Alarm<Periodic, 0>>>> = Mutex::new(RefCell::new(None));

pub fn setup_timer(systimer: TimeBase) {
// make sure the scheduling won't start before everything is setup
unsafe {
riscv::interrupt::disable();
}

let alarm0 = systimer.into_periodic();
alarm0.set_period(TIMER_DELAY.into());
alarm0.clear_interrupt();
Expand Down

0 comments on commit 5d91b1f

Please sign in to comment.