mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: targets/TARGET_ARM_SSG/TARGET_BEETLE/us_ticker.c
- Revision:
- 174:b96e65c34a4d
- Parent:
- 149:156823d33999
- Child:
- 182:a56a73fd2a6f
--- a/targets/TARGET_ARM_SSG/TARGET_BEETLE/us_ticker.c Fri Sep 15 14:59:18 2017 +0100 +++ b/targets/TARGET_ARM_SSG/TARGET_BEETLE/us_ticker.c Mon Oct 02 15:33:19 2017 +0100 @@ -91,20 +91,17 @@ } void us_ticker_set_interrupt(timestamp_t timestamp) { - int32_t delta = 0; - if (!us_ticker_inited) us_ticker_init(); - delta = (int32_t)(timestamp - us_ticker_read()); - /* Check if the event was in the past */ - if (delta <= 0) { - /* This event was in the past */ - Timer_SetInterrupt(TIMER0, 0); - return; - } + + uint32_t delta = timestamp - us_ticker_read(); + Timer_SetInterrupt(TIMER0, delta); +} - /* If the event was not in the past enable interrupt */ - Timer_SetInterrupt(TIMER0, delta); +void us_ticker_fire_interrupt(void) +{ + uint32_t us_ticker_irqn1 = Timer_GetIRQn(TIMER1); + NVIC_SetPendingIRQ((IRQn_Type)us_ticker_irqn1); } void us_ticker_disable_interrupt(void) {