Skip to content

Commit

Permalink
Only recompute allocated alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Nov 30, 2024
1 parent fdb8ee2 commit efee037
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion embassy-stm32/src/time_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl RtcDriver {
regs_gp16().cnt().write(|w| w.set_cnt(cnt as u16));

// Now, recompute all alarms
for i in 0..ALARM_COUNT {
for i in 0..self.alarm_count.load(Ordering::Relaxed) as usize {
let alarm_handle = unsafe { AlarmHandle::new(i as u8) };
let alarm = self.get_alarm(cs, alarm_handle);

Expand Down

0 comments on commit efee037

Please sign in to comment.