is there any way to repeat a C code N times with a macro? Also N is a macro.
For example if I have this macros:
#define N 5
#define COODE "nop\n\t"
#define REPEAT [...]
When I call repeat the preprocessor writes CODE N times, so
__asm__(REPEAT);
would became
__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");
I have an Arduino that have to wait for an exact (and small, about 10-15) number of clock. Each "nop" (no operation) takes exactly 1 clock cycle to be executed, and it does nothing. I can't just do a cycle, because each cycle is executed in more than one operation (initialize the counter, increment the counter, check if reached end), so instead of writing manually "nop\n\t" I'd like to have a macro. This way I can also simply change N to modify the program without rewriting it.
Thank you in advance