Commit Graph

7 Commits (5bddd881e98101f5c491cccf3367894ecb4e89dd)

Author SHA1 Message Date
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
Vincent Coubard 045b026ad4 NCS36510 RTC driver: Fix driver.
* Initialization clear interrupt status
* Remove state in management of interrupt
* Handle timestamp in the past
* Handle current seconds, even if out of the relative timestamp.
* Simplify interrupt handling logic.
2017-06-01 16:33:49 +01:00
Vincent Coubard 6fe07c640f Ticker NCS36510: Fix tests of the status register. 2017-05-31 19:16:05 +01:00
pradeep-gr 4e4823053a To resolve conflict 2016-10-26 15:00:19 +05:30
pradeep-gr 324dbaf0a1 Low power timer fine tuned for smaller duration 2016-10-12 19:09:57 +05:30
Laurent MEUNIER 22c50d32d2 cmsis to device changes 2016-10-12 14:54:43 +05:30
Christopher Haster 0bad622a16 restructure - Moved targets out to top level
hal/targets -> targets
hal/targets.json -> targets/targets.json
2016-09-30 19:18:09 -05:00