Skip to content

Commit 15c740f

Browse files
authored
Update us_ticker.c
1 parent 72ccf0b commit 15c740f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ static void lptmr_isr(void) {
185185
}
186186

187187
void us_ticker_set_interrupt(timestamp_t timestamp) {
188-
uint32_t tcur = us_ticker_read();
189-
int delta = (int)((uint32_t)timestamp - tcur);
188+
int delta = (int)((uint32_t)timestamp - us_ticker_read());
190189
if (delta <= 0) {
191190
// This event was in the past. Force it into the very near
192191
// future instead.
193-
timestamp = tcur + 2;
192+
delta = 1;
194193
}
195194

196195
us_ticker_int_counter = (uint32_t)(delta >> 16);

0 commit comments

Comments
 (0)