Open-Source-Ventilator
Open-Source-Ventilator copied to clipboard
Consider moving slow operations from ISR to mainloop
There are some relatively slow operations being triggered in the timer ISR (e.g. things that use I2C interface). It would simplify the architecture to use flags for the ISR to signal to the mainloop to perform these functions. Should be able to avoid nested interrupts completely with this approach and also eliminate the problem of synchronising access to the I2C bus.
Hi, I agree there is some rework to be done here in a future version, as it would allow offloading the processor during rapid inspiration (when I/E ratio is high) be delaying display updates. I'm still not sure if everything should go out of the timer interrupt or if the pressure sensor measurement should be there to ensure better regularity. It's an oscilloscope checking job ...
Anyways, a major update is on the way.