How to implement a few cycles delay macro or function
Hello,
I need to implement delay macro, lasting just a few cycles.
As the delay is so small I would not like to use TIMs o DWT.
On Texas Instruments DSPs, I was used to implement this nanoseconds delays, using NOP() instructions.
Unfortunately, as also written in STM32 Programming Manual this is not a good pattern on Cortex processors.
On a previous post, related to another issue, I was suggested to use Data Memory Barrier (DMB), Data Synchronization Barrier (DSB), and Instruction Synchronization Barrier (ISB) instructions, instead of NOPs.
How can I use this instructions, to implement a few cycles delay macro?
Regards,
Carlo
