<?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>What is the point of app_scheduler.h in the ble eddystone example?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28220/what-is-the-point-of-app_scheduler-h-in-the-ble-eddystone-example</link><description>The ble_app_eddystone example that comes with the SDK uses the scheduler, but I have failed to see where any handlers are registered to the scheduler (and grep -ing the eddystone library itself shows it uses the scheduler only in the flash-memory related</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Dec 2017 11:51:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28220/what-is-the-point-of-app_scheduler-h-in-the-ble-eddystone-example" /><item><title>RE: What is the point of app_scheduler.h in the ble eddystone example?</title><link>https://devzone.nordicsemi.com/thread/111460?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2017 11:51:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:525a5070-a926-4cd1-889d-57a6883071dd</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Hi Krastanov. The app_scheduler&amp;#39;s primary function is to move any processing out of the interrupt handlers and into the main loop. The advantages of this are short interrupt handlers &amp;amp; all interrupts are dealth with ASAP (&lt;a href="https://devzone.nordicsemi.com/question/1644/app_scheduler-app_timer/"&gt;see link&lt;/a&gt;). In the &lt;code&gt;main()&lt;/code&gt; function in the &lt;code&gt;main.c&lt;/code&gt; file, the scheduler is initialized first. Afterwards, the function &lt;code&gt;app_sched_execute()&lt;/code&gt; is run. This function executes all events scheduled since the last time it was called.&lt;/p&gt;
&lt;p&gt;Regarding your question: &amp;quot;is the scheduler told to do anything related to ble?&amp;quot;: It is true that no BLE activity is directly controlled by the scheduler. But in the eddystone example, the &lt;code&gt;APP_TIMER_CONFIG_USE_SCHEDULER&lt;/code&gt; enables scheduling of &lt;code&gt;app_timer&lt;/code&gt; to the &lt;code&gt;app_scheduler&lt;/code&gt;. So essentially you use the scheduler to cycle through the different eddystone adversting frames. Therefore, you could say that the &lt;code&gt;app_scheduler&lt;/code&gt; is indirectly used for BLE advertising.&lt;/p&gt;
&lt;p&gt;It might also be useful to take a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/ble_sdk_app_es.html?cp=4_0_4_4_1_2_6"&gt;Nordic Infocenter&lt;/a&gt; &amp;amp; this &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/lib_scheduler.html?cp=4_0_0_3_34"&gt;scheduler library link&lt;/a&gt;. This &lt;a href="https://devzone.nordicsemi.com/question/38180/sdk-app-scheduler/"&gt;devzone case&lt;/a&gt; could also be useful, as well as taking a look at &lt;a href="https://devzone.nordicsemi.com/tutorials/23/"&gt;the scheduler tutorial&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the point of app_scheduler.h in the ble eddystone example?</title><link>https://devzone.nordicsemi.com/thread/111459?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 07:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47aa921a-2207-4f4e-a56d-10ca7dc3400a</guid><dc:creator>shibshab</dc:creator><description>&lt;p&gt;The scheduler is used (as you state) for performing the garbage collection.
The &lt;code&gt;app_timer&lt;/code&gt; library also uses the scheduler (see the &lt;code&gt;APP_TIMER_CONFIG_USE_SCHEDULER&lt;/code&gt; config).
No BLE activity is directly controlled by the scheduler.&lt;/p&gt;
&lt;p&gt;If you want to remove the scheduler dependency, implement some check in main-context whether or not garbage collection should be done, and change the config of &lt;code&gt;app_timer&lt;/code&gt; to not use the scheduler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>