<?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>How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119569/how-can-i-use-my-own-scheduler-with-app_timer</link><description>Hello everyone, 
 
 This might be a somewhat silly question. I&amp;#39;m trying to use SDK v17.1, and have an issue with the app_timer library. 
 I remember that before SDK v13 one would init app_timer with the APP_TIMER_INIT() macro, and there one should input</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Mar 2025 19:21:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119569/how-can-i-use-my-own-scheduler-with-app_timer" /><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/529145?ContentTypeID=1</link><pubDate>Wed, 26 Mar 2025 19:21:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9e1c6dd-b1b5-42c6-8225-bea0dda59884</guid><dc:creator>julian24</dc:creator><description>&lt;p&gt;It was completely my fault, misusing the scheduler.&lt;br /&gt;Now i&amp;#39;ve been able to use my previous scheduler as a wrapper for app_scheduler&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanks for everything, Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/527076?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 05:33:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6b65ace-57f1-47a4-9dee-15093f042f3e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Julián,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you calling&amp;nbsp;app_sched_execute() from the main loop and&amp;nbsp;APP_SCHED_INIT() on init like in the ble_app_hids_ examples? The scheduler queue cannot be cleared.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/527036?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 18:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d09495db-3241-4ccf-86d7-a6f837f0511c</guid><dc:creator>julian24</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Yes, I agree, it&amp;#39;s a bit excessive. I&amp;#39;m now using app_scheduler, and my own, previous, scheduler now functions as a wrapper for app_scheduler so I don&amp;#39;t have to change all my code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, I have a problem when using timers with the scheduler. Even though the timer interruptions function properly and I can get them to work normally, I keep getting events put into the schedule by the RTC (see image).&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741803110709v1.png" /&gt;&lt;br /&gt;&lt;br /&gt;At some point in my code, I need to check if there are tasks scheduled pending to be executed in order to decide if the code shall go on or keep cycling. Since RTC keeps putting events into the schedule, I can never get to see an empty task queue.&lt;/p&gt;
&lt;p&gt;I need to understand why this happens, and if there&amp;#39;s any way to prevent it while still using app_timer with app_scheduler. I&amp;#39;ve read both libs documentation but there&amp;#39;s no specification on this.&lt;br /&gt;&lt;br /&gt;Maybe it&amp;#39;s my error on the configuration.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By the way, is there some way to clear the schedule?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Juli&amp;aacute;n&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/526376?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 14:40:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8707c13e-6bd1-41b0-b887-a7dec56ea5a0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Julián,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Using app_scheduler() in addition to your own&amp;nbsp;scheduler sounds &amp;nbsp;a bit excessive. Can you enqueue your scheduler tasks from the app timer timeout handlers instead (interrupt context)?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/526175?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2025 12:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52d4d36e-f775-494d-bccc-019488a799ed</guid><dc:creator>julian24</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;If i use it with app_scheduler, can i register my scheduler as a handler? or do i have to schedule my own scheduler as a task each time?&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Juli&amp;aacute;n&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/526169?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2025 12:49:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11f6f503-7aa0-440c-9a7d-2ec69e91455f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The app timer library was rewritten as app_timer2.&amp;nbsp; Unfortunately it no longer supports user provided scheduler functions. However, it can optionally be used with app_scheduler by enabling the APP_TIMER_CONFIG_USE_SCHEDULER setting in sdk_config.h. Is it an alternative to just add your tasks to your scheduler from the app timer interrupts instead?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can I use my own scheduler with app_timer?</title><link>https://devzone.nordicsemi.com/thread/526060?ContentTypeID=1</link><pubDate>Wed, 05 Mar 2025 19:16:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0503803-aac0-44f5-a6f0-694bf9db5ca2</guid><dc:creator>julian24</dc:creator><description>&lt;p&gt;PS:&lt;br /&gt;&lt;br /&gt;More specifically, I&amp;#39;m trying to migrate my code to SDK v17.1, and am currently in this situation pointed out in the Migration Note. I&amp;#39;d like to specify my scheduler function as I did before, in SDKs previous to SDK v13.0.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741202196252v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>