<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>do-while macro expansion error APP_SCHED_INIT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51107/do-while-macro-expansion-error-app_sched_init</link><description>In following this example: https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/scheduler-tutorial 
 
 once I added 
 APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE); 
 The following error results: 
 3</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Aug 2019 06:25:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51107/do-while-macro-expansion-error-app_sched_init" /><item><title>RE: do-while macro expansion error APP_SCHED_INIT</title><link>https://devzone.nordicsemi.com/thread/205173?ContentTypeID=1</link><pubDate>Wed, 21 Aug 2019 06:25:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:afa1da4b-2639-46f8-9947-d28a87e2eac1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I can really say. It was just a gut feeling, and when I tested it seemed to be correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: do-while macro expansion error APP_SCHED_INIT</title><link>https://devzone.nordicsemi.com/thread/205084?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 14:18:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4ee59c9-09a9-4955-9bd8-9189c435b08a</guid><dc:creator>morerook</dc:creator><description>&lt;p&gt;You are absolutely right!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But I am wondering, just for my own knowledge, how you managed to catch that just from the error code I provided?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: do-while macro expansion error APP_SCHED_INIT</title><link>https://devzone.nordicsemi.com/thread/204969?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 09:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b97998c-4e1b-44c7-8d11-aa9df8672e9b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Based on the error it seems like you put the call to&amp;nbsp;APP_SCHED_INIT() outside a function. The tutorial states you should write the line with the call to&amp;nbsp;APP_SCHED_INIT() &amp;quot;above your &lt;strong&gt;main loop&lt;/strong&gt;&amp;quot;, which is not to be confused with above your &lt;strong&gt;main function&lt;/strong&gt;. To be clear, your main function should look like the following after that step:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{
    lfclk_request();
    log_init();
    gpio_init();
    timer_init();

    NRF_LOG_INFO(&amp;quot;Scheduler tutorial example started.&amp;quot;);

    APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);

    // Enter main loop.
    while (true)
    {
        __WFI();
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>