brandonbraun653 / Chimera

A generalized high level interface to commonly used embedded systems resources
MIT License
4 stars 0 forks source link

Add ISR Support for Fast Callbacks and Delayed Callbacks #15

Open brandonbraun653 opened 4 years ago

brandonbraun653 commented 4 years ago

After listening to the Embedded.FM podcast and hearing complaints about the STM32 HAL's slow ISR handling, I've decided that it would be a good idea to add support for two kinds of event driven ISR callbacks to cater to the different system needs.

  1. Asynchronous callbacks that can execute in user space and use all standard RTOS utilities.
  2. Immediate callbacks that execute inside of the ISR context. Limited scope in what can and cannot be done. Consider passing in a copy of the registers into the callback function.
brandonbraun653 commented 4 years ago

Implementation thoughts: It would be nice if each peripheral instance had the option to register 1 asynchronous callback and 1 immediate callback. If more than one is needed, then the registered hook can expand things further and call into more functions. This should limit complexity and allow faster execution.