mbed-os/targets/TARGET_Realtek/TARGET_AMEBA
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_RTL8195A Merge pull request #4487 from Archcady/Realtek_TCM 2017-06-11 01:09:51 -05:00
sdk Resolve Realtek device small code space issue 2017-06-10 09:46:01 -05:00
RTWInterface.cpp resolve RTWInterface initialization run after error issue 2017-06-03 20:15:04 +01:00
RTWInterface.h remove unused class member from RTWInterface 2017-06-03 20:15:00 +01:00
analogin_api.c improve coding style 2017-06-03 20:15:04 +01:00
analogin_ext.h add support for REALTEK_RTL8195AM 2017-06-03 20:14:45 +01:00
analogout_api.c add comment for the delay in analogout_api.c 2017-06-03 20:15:04 +01:00
flash_api.c Coding style fix 2017-06-27 11:33:46 +08:00
flash_ext.c Coding style fix 2017-06-27 11:33:46 +08:00
flash_ext.h Add FlashIAP support for REALTEK_RTL8195AM 2017-06-15 16:27:08 +08:00
gpio_api.c improve coding style 2017-06-03 20:15:04 +01:00
gpio_irq_api.c code style fix 2017-06-03 20:14:59 +01:00
i2c_api.c fix multiple i2c peripherals possible conflicting issue 2017-06-03 20:15:04 +01:00
log_uart_api.c improve coding style 2017-06-03 20:15:04 +01:00
log_uart_api.h add support for REALTEK_RTL8195AM 2017-06-03 20:14:45 +01:00
port_api.c improve coding style 2017-06-03 20:15:04 +01:00
pwmout_api.c improve coding style 2017-06-03 20:15:04 +01:00
rtc_api.c Simplify Ameba RTC driver 2017-06-07 22:03:27 -05:00
rtw_emac.cpp resolve RTWInterface initialization run after error issue 2017-06-03 20:15:04 +01:00
rtw_emac.h Fix on Wifi 2017-06-03 20:14:58 +01:00
serial_api.c improve coding style 2017-06-03 20:15:04 +01:00
spi_api.c spi: Added default spi_master_block_write implementation to REALTEK_RTL8195AM 2017-06-03 17:14:11 -05:00
timer_api.c code style fix 2017-06-03 20:14:59 +01:00
timer_api.h add support for REALTEK_RTL8195AM 2017-06-03 20:14:45 +01:00
trng_api.c code style fix 2017-06-03 20:14:59 +01:00
us_ticker.c Ticker: add fire interrupt now function 2017-07-13 12:23:25 +01:00