We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 094d9ac commit 72ccf0bCopy full SHA for 72ccf0b
targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c
@@ -185,13 +185,14 @@ static void lptmr_isr(void) {
185
}
186
187
void us_ticker_set_interrupt(timestamp_t timestamp) {
188
- int delta = (int)((uint32_t)timestamp - us_ticker_read());
+ uint32_t tcur = us_ticker_read();
189
+ int delta = (int)((uint32_t)timestamp - tcur);
190
if (delta <= 0) {
- // This event was in the past:
191
- us_ticker_irq_handler();
192
- return;
193
- }
194
-
+ // This event was in the past. Force it into the very near
+ // future instead.
+ timestamp = tcur + 2;
+ }
195
+
196
us_ticker_int_counter = (uint32_t)(delta >> 16);
197
us_ticker_int_remainder = (uint16_t)(0xFFFF & delta);
198
if (us_ticker_int_counter > 0) {
0 commit comments