keyplus
keyplus copied to clipboard
Add timer event system
Many system need to perform task when a timer expiers. Currently most of the system that use this now are each running their own tasks that are checking if their timers have expired. Generalizing the system would allow them to share code and the memory used to track timers.
It would make it easier to use interrupt timers instead of relying on polling to check if the tasks should be triggered. The interrupt system would only need to be set for the timer that is closest to expiring. When that timer expires, the interrupt would be called, the appropriate task run, and the interrupt would be reset to the next timer. This would benefit a future bluetooth implementation as it would allow the code to sleep much more than the current system.