AnsweredAssumed Answered

Microseconds delay assembler inline routine IAR EWARM 6.3

Question asked by Reddy.Harinadha on Dec 19, 2012
Latest reply on Dec 21, 2012 by Clive One
I need precise microseconds delay routine in my application ( uses STM32F103RE)
I saw Leaflabs Library 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 has experience in writing code using IAR embedded workbech, suggestions please .
Thanks in advance.


Outcomes