Skip to content

Commit

Permalink
Yeah okay
Browse files Browse the repository at this point in the history
  • Loading branch information
simmsb committed Jul 13, 2024
1 parent 3d77d03 commit 6ca147f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Alarm {
static IN_PROGRESS: Mutex<Cell<bool>> = Mutex::new(Cell::new(false));

pub fn mark_in_progress(cs: CriticalSection) -> bool {
IN_PROGRESS.borrow(cs).replace(true)
!IN_PROGRESS.borrow(cs).replace(true)
}

pub fn mark_finished(cs: CriticalSection) {
Expand Down Expand Up @@ -285,7 +285,9 @@ pub unsafe fn handle_tick() {
}

avr_device::interrupt::free(|t| {
mark_finished(t);
if should_process {
mark_finished(t);
}
let mut state = INTERRUPT_STATE.borrow(t).borrow_mut();
state.as_mut().unwrap().counter.clear_interrupt();
});
Expand Down

0 comments on commit 6ca147f

Please sign in to comment.