Ticker: add fire interrupt now function
fire_interrupt function should be used for events in the past. As we have now
64bit timestamp, we can figure out what is in the past, and ask a target to invoke
an interrupt immediately. The previous attemps in the target HAL tickers were not ideal, as it can wrap around easily (16 or 32 bit counters). This new
functionality should solve this problem.

set_interrupt for tickers in HAL code should not handle anything but the next match interrupt. If it was in the past is handled by the upper layer.

It is possible that we are setting next event to the close future, so once it is set it is already in the past. Therefore we add a check after set interrupt to verify it is in future.
If it is not, we fire interrupt immediately. This results in
two events - first one immediate, correct one. The second one might be scheduled in far future (almost entire ticker range),
that should be discarded.

The specification for the fire_interrupts are:
- should set pending bit for the ticker interrupt (as soon as possible),
the event we are scheduling is already in the past, and we do not want to skip
any events
- no arguments are provided, neither return value, not needed
- ticker should be initialized prior calling this function (no need to check if it is already initialized)

All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
ls
1 parent aae62bd commit 10ea63b8e7f804b6584fee85b375cd2b3e2cba4c
@Martin Kojtal Martin Kojtal authored on 27 Jun 2017
Showing 68 changed files
View
hal/lp_ticker_api.h
View
hal/mbed_lp_ticker_api.c
View
hal/mbed_ticker_api.c
View
hal/mbed_us_ticker_api.c
View
hal/ticker_api.h
View
hal/us_ticker_api.h
View
targets/TARGET_ARM_SSG/TARGET_BEETLE/lp_ticker.c
View
targets/TARGET_ARM_SSG/TARGET_BEETLE/us_ticker.c
View
targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/us_ticker.c
View
targets/TARGET_ARM_SSG/TARGET_IOTSS/us_ticker.c
View
targets/TARGET_ARM_SSG/TARGET_MPS2/us_ticker.c
View
targets/TARGET_Atmel/TARGET_SAM_CortexM4/lp_ticker.c
View
targets/TARGET_Atmel/TARGET_SAM_CortexM4/us_ticker.c
View
targets/TARGET_Freescale/TARGET_K20XX/TARGET_K20D50M/us_ticker.c
View
targets/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/us_ticker.c
View
targets/TARGET_Freescale/TARGET_KLXX/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL27Z/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL43Z/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KL82Z/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW24D/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K22F/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K24F/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/us_ticker.c
View
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/lp_ticker.c
View
targets/TARGET_Maxim/TARGET_MAX32600/rtc_api.c
View
targets/TARGET_Maxim/TARGET_MAX32600/us_ticker.c
View
targets/TARGET_Maxim/TARGET_MAX32610/rtc_api.c
View
targets/TARGET_Maxim/TARGET_MAX32610/us_ticker.c
View
targets/TARGET_Maxim/TARGET_MAX32620/rtc_api.c
View
targets/TARGET_Maxim/TARGET_MAX32620/us_ticker.c
View
targets/TARGET_Maxim/TARGET_MAX32625/rtc_api.c
View
targets/TARGET_Maxim/TARGET_MAX32625/us_ticker.c
View
targets/TARGET_Maxim/TARGET_MAX32630/rtc_api.c
View
targets/TARGET_Maxim/TARGET_MAX32630/us_ticker.c
View
targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c
View
targets/TARGET_NORDIC/TARGET_NRF5/lp_ticker.c
View
targets/TARGET_NORDIC/TARGET_NRF5/us_ticker.c
View
targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c
View
targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c
View
targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c
View
targets/TARGET_NUVOTON/TARGET_NUC472/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC11U6X/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC11UXX/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC11XX_11CXX/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC13XX/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC15XX/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC176X/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC408X/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC43XX/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC81X/us_ticker.c
View
targets/TARGET_NXP/TARGET_LPC82X/us_ticker.c
View
targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_lp_ticker_api.c
View
targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c
View
targets/TARGET_ONSEMI/TARGET_NCS36510/rtc.c
View
targets/TARGET_RENESAS/TARGET_RZ_A1H/us_ticker.c
View
targets/TARGET_RENESAS/TARGET_VK_RZ_A1H/us_ticker.c
View
targets/TARGET_Realtek/TARGET_AMEBA/us_ticker.c
View
targets/TARGET_STM/lp_ticker.c
View
targets/TARGET_STM/us_ticker_16b.c
View
targets/TARGET_STM/us_ticker_32b.c
View
targets/TARGET_Silicon_Labs/TARGET_EFM32/lp_ticker.c
View
targets/TARGET_Silicon_Labs/TARGET_EFM32/us_ticker.c
View
targets/TARGET_WIZNET/TARGET_W7500x/us_ticker.c
View
targets/TARGET_ublox/TARGET_HI2110/lp_ticker.c
View
targets/TARGET_ublox/TARGET_HI2110/us_ticker.c