Closed mpv89 closed 5 years ago
Be sure to consider where the removal of critical sections requires the addition of mutexes at each stage.
Commit 41396e5 extends the InterruptBasedDriver class to support two new methods: enableInterrupts and disableInterrupts. These can be used inside drivers instead of enterCRITICAL / exitCRITICAL and will only enable or disable driver specific interrupts. The PS UART driver is a good example of how this is used.
Some drivers might be doing excessive use of disable/enable of global interrupts for critical portions of the code, this can cause considerable slow down if many drivers do this. Consider audit drivers and changing the disable/enable from global interrupts to interrupts only used by said driver.