mbed
Fork of mbed-dev by
Diff: targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c
- Revision:
- 162:e13f6fdb2ac4
- Parent:
- 149:156823d33999
- Child:
- 175:b96e65c34a4d
diff -r 2cc1468da177 -r e13f6fdb2ac4 targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c --- a/targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c Thu Mar 30 13:45:57 2017 +0100 +++ b/targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c Wed Apr 12 16:21:43 2017 +0100 @@ -187,11 +187,11 @@ void us_ticker_set_interrupt(timestamp_t timestamp) { int delta = (int)((uint32_t)timestamp - us_ticker_read()); if (delta <= 0) { - // This event was in the past: - us_ticker_irq_handler(); - return; - } - + // This event was in the past. Force it into the very near + // future instead. + delta = 1; + } + us_ticker_int_counter = (uint32_t)(delta >> 16); us_ticker_int_remainder = (uint16_t)(0xFFFF & delta); if (us_ticker_int_counter > 0) {