3 ms·
> As soon as you have long running (long is a relative thing) it is extremely difficult to guarantee any behavior of the system. I understand your sentiment bu
by barbegal 6y ago
> As soon as you have long running (long is a relative thing) it is extremely difficult to guarantee any behavior of the system.
I understand your sentiment but simply pushing the work into a task doesn't make guaranteeing the behavior of the system any easier. And I argue that in some cases, it makes it more difficult, if you can eliminate an entire task by putting its processing in an ISR then that reduces the complexity. Handling priority inversion correctly is the example that springs to mind.
- craftinator 6y agoI think that in some cases, large ISR tasks make sense. But, ISRs by nature occur at times not known at compile time, meaning that the longer an ISR runs, the less you'll know about system behavior at compile time. So, if you know that you need a long running process triggered by an ISR, that's fine, make it so; but as a general rule of thumb, the shorter the ISR, the more deterministic your system is. Those ISR runtimes need to be designed to be good fits for the system, or they can cause problems.