Skip to content

Commit

Permalink
Fix SYSTIMER time driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed May 29, 2024
1 parent 46c3d3e commit c39a587
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions esp-hal-embassy/src/time_driver/systimer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ impl EmbassyTimer {
}

fn arm(&self, id: usize, timestamp: u64) {
let now = SystemTimer::now();

match id {
0 => unwrap!(self.alarm0.load_value(timestamp.micros())),
1 => unwrap!(self.alarm1.load_value(timestamp.micros())),
2 => unwrap!(self.alarm2.load_value(timestamp.micros())),
0 => unwrap!(self.alarm0.load_value(timestamp.micros() - now)),
1 => unwrap!(self.alarm1.load_value(timestamp.micros() - now)),
2 => unwrap!(self.alarm2.load_value(timestamp.micros() - now)),
_ => {}
}
}
Expand Down

0 comments on commit c39a587

Please sign in to comment.