Question
Microseconds delay assembler inline routine IAR EWARM 6.3
Posted on December 19, 2012 at 07:19
I needprecise microseconds delay routine in myapplication ( uses STM32F103RE)
I sawhttps://github.com/leaflabs/libmaple/blob/master/libmaple/include/libmaple/delay.h
for microseconds delay routine. It has the following:static
inline
void
delay_us(uint32 us) {
us *= STM32_DELAY_US_MULT;
/* fudge for function call overhead */
us--;
asm
volatile
(
'' mov r0, %[us] \n\t''
''1: subs r0, #1 \n\t''
'' bhi 1b \n\t''
:
: [us]
''r''
(us)
:
''r0''
);
}
I'm trying to rewrite this routing in IAR EWARM 6.3
I would like to write the same function in IAR EWARM 6.3
I get the following error if I use the same code:
Error[Og006]: Syntax error in inline assembly: ''Error[41]: Bad label''
Anyone who hasexperience in writing code using IAR embedded workbech, suggestions pleas
