I’ve got a crit section in my app and I need a delay for a predetermined amount of time in this crit section (no way around it). RTOS API doesn’t work in a crit section so what’s the best solution for this? I was thinking about time.h functions
Also, on the same topic - how to measure runtime in the crit section. I also need to implement that.
Maybe, or maybe your don’t really want a critical section but use a mutex to protect the resource.
The key thing is that critical sections are usually SHORT sections of code where either you need to protect something from an ISR, or a short enough that the quickness of the critical section over other forms of protection makes it useful. If you really need to protect something from an ISR for that long, disable the needed interrupt.