Skip to content

Fix for issue #6054 - interrupts scheduled in the past. #6068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hal/mbed_ticker_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,14 @@ static void schedule_interrupt(const ticker_data_t *const ticker)
}

timestamp_t match_tick = compute_tick(ticker, match_time);
// The time has been checked to be future, but it could still round
// to the last tick as a result of us to ticks conversion
if (match_tick == queue->tick_last_read) {
// Match time has already expired so fire immediately
ticker->interface->fire_interrupt();
return;
}

ticker->interface->set_interrupt(match_tick);
timestamp_t cur_tick = ticker->interface->read();

Expand Down