mbed-os/hal
Martin Kojtal 10ea63b8e7 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.
2017-07-13 12:23:25 +01:00
..
TARGET_FLASH_CMSIS_ALGO Renamed files in platform to match source names 2017-02-22 18:17:54 -06:00
storage_abstraction Removed bad \ref tag, but left in the tag name. Updated old param names in gpio_api.h and added new params in ticker_api.h 2017-06-08 15:52:31 -05:00
analogin_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
analogout_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
buffer.h Add tags to our code 2016-10-04 15:02:44 -05:00
can_api.h Add an mbed API that allows the initialization of the CAN at the correct 2017-05-15 14:14:26 +02:00
can_helper.h Fix doxygen warnings in 'drivers' 2017-06-08 15:53:53 -05:00
dma_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
emac_api.h Moved emac_api.h to the appropriate folder 2016-11-17 13:52:42 -06:00
ethernet_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
flash_api.h FlashIAP: Add explicit read function to flash_api.h 2017-07-06 18:53:32 +01:00
gpio_api.h Removed bad \ref tag, but left in the tag name. Updated old param names in gpio_api.h and added new params in ticker_api.h 2017-06-08 15:52:31 -05:00
gpio_irq_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
i2c_api.h I2C - correct return values for write functions 2016-11-21 11:26:02 +00:00
lp_ticker_api.h Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00
mbed_flash_api.c FlashIAP: Add explicit read function to flash_api.h 2017-07-06 18:53:32 +01:00
mbed_gpio.c For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
mbed_lp_ticker_api.c Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00
mbed_pinmap_common.c For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
mbed_ticker_api.c Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00
mbed_us_ticker_api.c Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00
pinmap.h Add tags to our code 2016-10-04 15:02:44 -05:00
port_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
pwmout_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
rtc_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
serial_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
sleep_api.h Platform: Add sleep/deepsleep user facing functions 2017-01-19 09:39:29 +00:00
spi_api.h spi: Added block-level SPI writes at the HAL level 2017-05-25 12:04:58 -05:00
ticker_api.h Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00
trng_api.h Add tags to our code 2016-10-04 15:02:44 -05:00
us_ticker_api.h Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00