<?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>While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54579/while-loop-for-flags-resolution-and-tickers</link><description>I am using SDK 15.3 and wanted to ask that if there is a while loop where I can check flags and increment tickers. The program at the moment gets stuck inside 
 
 Suggestions would be greatly appreciated.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Nov 2019 04:45:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54579/while-loop-for-flags-resolution-and-tickers" /><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221979?ContentTypeID=1</link><pubDate>Tue, 26 Nov 2019 04:45:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6641a12d-9715-491b-ad51-bf0257b05071</guid><dc:creator>Ameer Usman</dc:creator><description>&lt;p&gt;Great, Thank you Jared &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221870?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 13:52:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ae02422-c233-4dce-b429-974d792b3389</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t see any problems with it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221820?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 11:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a14b2532-3314-406b-b6e6-9d0a70beab7b</guid><dc:creator>Ameer Usman</dc:creator><description>&lt;p&gt;So in short the placing the flag after idle_state_handle() of perform_blink() or in my case change_advert_type() is ok to do? As I want to perform change_advert_type() right after an event is performed by checking a flag in the for loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221771?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2019 09:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60c7a776-0615-429d-929a-bb604d64997b</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;No, the&amp;nbsp;idle_state_handle() will put the IC into a low-power state until an event occurs. Any functions placed after the idle_state_handle() will be called after the IC has &amp;quot;woken up&amp;quot; from the low power state to handle the event generated.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221705?ContentTypeID=1</link><pubDate>Sun, 24 Nov 2019 09:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5644fb78-6454-48f3-bf96-8e92d46da6a7</guid><dc:creator>Ameer Usman</dc:creator><description>&lt;p&gt;Will this cause a problem in the sleep function of the controller? As I am using BLE as well and I do not want to compromise the battery life due to it. This is only the perform_blink() function but I was hoping to add some other tickers for checking other things as well, would that be wise? Considering the device will be run on a battery.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221704?ContentTypeID=1</link><pubDate>Sun, 24 Nov 2019 07:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37da377e-6f8d-4af6-9862-a1017ed7e26a</guid><dc:creator>Ameer Usman</dc:creator><description>&lt;p&gt;Great will give it a go.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221318?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 12:41:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a83d2c5f-3273-431f-b706-756f1f5ef353</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, perform_blink() function should be called after the CPU has returned after waking up from IDLE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221251?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 09:29:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e71a00f-9fcc-4453-9561-3e2447d7120e</guid><dc:creator>Ameer Usman</dc:creator><description>&lt;p&gt;Ok so if I want to check an if statement inside the for loop, would it be checked? like e.g.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;for (;;)
{     
    idle_state_handle();
    if (flag == 1)
    {
        perform_blink();
        flag == 0;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;will the perform_blink() function be performed each time the flag is raised?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop for Flags resolution and Tickers</title><link>https://devzone.nordicsemi.com/thread/221248?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 09:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e02be6c-4b66-4e63-9bce-1415a071da87</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I understand your question, could you elaborate? Which example are you using? Idle_state_handle() is a function that puts the nRF to sleep until the next event.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>