<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: microseconds delay function in IAR EWARM</title>
		<link>http://forums.leaflabs.com/topic.php?id=9941</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:16:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=9941" rel="self" type="application/rss+xml" />

		<item>
			<title>Harinath on "microseconds delay function in IAR EWARM"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9941#post-21736</link>
			<pubDate>Wed, 19 Dec 2012 20:42:06 +0000</pubDate>
			<dc:creator>Harinath</dc:creator>
			<guid isPermaLink="false">21736@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The error comes only when the function is called &#38;amp; compiled, doesn't appear when not called. Also, The above error appears at the last line of code( but this code line number is not 41 in my header file).&#60;br /&#62;
I modified according to your suggestions &#38;amp; compiled, but still no luck.&#60;br /&#62;
Is this assembler code is equivalent of C language version :&#60;br /&#62;
while (delay_us--);&#60;/p&#62;
&#60;p&#62;The following link may help us go little forward:&#60;br /&#62;
&#60;a href=&#34;http://supp.iar.com/Support/?note=31237&#38;amp;from=search+result&#34; rel=&#34;nofollow&#34;&#62;http://supp.iar.com/Support/?note=31237&#38;amp;from=search+result&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>tormod on "microseconds delay function in IAR EWARM"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9941#post-21731</link>
			<pubDate>Wed, 19 Dec 2012 15:01:24 +0000</pubDate>
			<dc:creator>tormod</dc:creator>
			<guid isPermaLink="false">21731@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It would have been useful if you told us which line is 41. Anyway, the label &#34;1&#34; (the number one) is a local label, referred to by &#34;1b&#34; (b for backwards) [1]. Maybe local labels or numbers as labels are not allowed in IAR. Try replacing them with a text label like &#34;loop_us&#34;. The stuff between the colons after the assembly code string is for telling the compiler which registers and variables should be used for input and output, and this might be GCC specific [2]. I think you can use the C variable name directly in IAR assembly, so that the first line would be &#34; mov r0, us \n\t&#34; and the colon-separated stuff can be skipped.&#60;/p&#62;
&#60;p&#62;Or you can just code it in C and calibrate STM32_DELAY_US_MULT accordingly: Declare &#34;us&#34; volatile and use: while (us--);&#60;/p&#62;
&#60;p&#62;[1] &#60;a href=&#34;http://sourceware.org/binutils/docs-2.23.1/as/Symbol-Names.html#index-local-labels-217&#34; rel=&#34;nofollow&#34;&#62;http://sourceware.org/binutils/docs-2.23.1/as/Symbol-Names.html#index-local-labels-217&#60;/a&#62;&#60;br /&#62;
[2] &#60;a href=&#34;http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html&#34; rel=&#34;nofollow&#34;&#62;http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Harinath on "microseconds delay function in IAR EWARM"</title>
			<link>http://forums.leaflabs.com/topic.php?id=9941#post-21719</link>
			<pubDate>Wed, 19 Dec 2012 00:43:02 +0000</pubDate>
			<dc:creator>Harinath</dc:creator>
			<guid isPermaLink="false">21719@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I saw the GitHub repo of libmaple/delay.h&#60;/p&#62;
&#60;p&#62;static inline void delay_us(uint32 us) {&#60;br /&#62;
    us *= STM32_DELAY_US_MULT;&#60;/p&#62;
&#60;p&#62;    /* fudge for function call overhead  */&#60;br /&#62;
    us--;&#60;br /&#62;
    asm volatile(&#34;   mov r0, %[us]          \n\t&#34;&#60;br /&#62;
                 &#34;1: subs r0, #1            \n\t&#34;&#60;br /&#62;
                 &#34;   bhi 1b                 \n\t&#34;&#60;br /&#62;
                 :&#60;br /&#62;
                 : [us] &#34;r&#34; (us)&#60;br /&#62;
                 : &#34;r0&#34;);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;I would like to write the same function in IAR EWARM 6.3&#60;br /&#62;
I get the following error if I use the same code:&#60;/p&#62;
&#60;p&#62;Error[Og006]: Syntax error in inline assembly: &#34;Error[41]: Bad label&#34;&#60;/p&#62;
&#60;p&#62;Anyone who has writing code in IAR embedded workbech, suggestions please .
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
