What a weird topic name isn’t it :
I’m trying to do a quick and dirty port of a timing critical code (guess from which platform ;))
I have critical section I would like to protect from interrupts, any interrupts, any disturbance.
While the code has a single thread, there is still timer and serial interrupt that could break my code flow.
So I am looking for an equivalent of cli()
I also need to do fine tuning delays in the microsecond domain (from 10 to 1000), so Thread.Sleep() is not an option.
If there is no existing function, can I use a timer ?
Reading timer counter until it reaches a value would work.
If you are about to say RLP, cross the street to the other side.
I said quick_and_dirty ;D