Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ticker: add fire interrupt now function #4644
fire_interrupt function should be used for events in the past. As we have now
The most important bit in here is at https://github.com/ARMmbed/mbed-os/pull/4644/files#diff-5103d7d35f905c001a8c673abbeb73f1. This is generic handling of events in the past, we here know that an event is already in the past, we need to invoke its handler now now, thus this removes any questions in the HAL tickers (is this already in the past).
Naming can be improved, I went ahead with
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.
The specification for the fire_interrupts are:
All our targets provide this new functionality, removing old misleading if (timestamp is in the past) checks.
This needs testing. We have already proposed ticker port, #4628 . I believe that PR could be updated, based on this requirement and test it.
Once we agree on the naming and that this is desired, I'll tag any vendor maintainer to review this that we cleaned the set_interrupt properly and fire_interrupt is implemented correctly (most of the implementation is SetPendingIRQ, but some need additional handling).
Some targets do delta calculation in set_interrupt, is that correct? I assume those timers do not have always counting up/down tickers, and thus use delta to set the next capture, I left it untouched, but shall be reviewed.
I expect to do some rebase based on the reviews and CI as this touches too many targets.