If set_interrupt() is used to setup an interrupt for a time in the past, then the callback is invoked right-away.

pull/932/head
Rohit Grover 2015-02-25 12:20:15 +00:00 committed by Rohit Grover
parent ac8f3e5522
commit 42f801cc27
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
}
uint32_t newCallbackTime = MICROSECONDS_TO_RTC_UNITS(timestamp);
if (newCallbackTime == rtc1_getCounter()) {
if ((int)(newCallbackTime - rtc1_getCounter()) <= 0) {
INVOKE_CALLBACK();
return;
}