-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
To keep the core asleep as long as possible, minimize wakeups and therefore minimize power consumption, it would be useful to have a way to define "flexible" timers/tickers that, instead of specifying exactly the instant when the next wakeup should happen, define a range of "acceptable" instants for that timer/ticker to fire at. This would allow the executor to pick the next wakeup instant in such a way to service as many timers/tickers at once (as long as all those timers/tickers have overlapping "acceptable" ranges).
For example, assuming three acceptable ranges (1, 5), (2, 4), (3, 6) the executor could choose to set the wakeup for the latest instant that satisfies all ranges (4). If then an independent interrupt is received at time (2), the executor could immediately service the first two timers and reset the next wakeup to (6).
This could take the (pseudo-)form of
- Timer(T, E, L)
- A timer that should preferably fire at time (T), but is allowed to fire at any time in the range (E, L)
- E <= T <= L
- Timer(T) is equivalent to Timer(T, T, T)
- When operating outside of a low-power regime, the executor can choose to more closely honour the preferred time T
- Ticker(T, E, L)
- A ticker with a period of T, but each tick is allowed to fire with a jitter in the range (E-T, L-T) from the expected time of the i-th tick Ti=i*T.
- E <= T <= L
- Ticker(T) is equivalent to Ticker(T, T, T)
- When operating outside of a low-power regime, the executor can choose to reduce the jitter by more closely firing in line with the period T
- Delay(T, E, L)
- A delay of preferred duration T, but is allowed to be between any duration in the range (E, L)
- E <= T <= L
- Delay(T) is equivalent to Delay(T, T, T)
- When operating outside of a low-power regime, the executor can choose to more closely honour the preferred time T