<?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>timer events triggered in a row</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27304/timer-events-triggered-in-a-row</link><description>Hi 
 I seek your support for the following 2 app_timer (or else) issue: 
 (1)
in there any reason as to why multiple app_timers will sometime trigger all in a row although they have very different timeouts? 
 My case is button detection for short</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Nov 2017 11:56:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27304/timer-events-triggered-in-a-row" /><item><title>RE: timer events triggered in a row</title><link>https://devzone.nordicsemi.com/thread/107869?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2017 11:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:045f100a-30f1-4c77-8281-4dca04c2a4ec</guid><dc:creator>jy</dc:creator><description>&lt;p&gt;however ... in combination with increasing APP_TIMER_PRESCALER from 0 to 32 and decreasing APP_TIMER_OP_QUEUE_SIZE ... I cannot make it fail anymore; any potential explanation? giving more time for handlers?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer events triggered in a row</title><link>https://devzone.nordicsemi.com/thread/107870?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2017 11:13:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8ee2fd1-680e-45ba-98de-2ffa31e1822d</guid><dc:creator>jy</dc:creator><description>&lt;p&gt;thx Kenneth for your prompt reply! unfortunately, it seems not sufficient ... following your hint, and looking at sdk12, I also tried to add  rtc1_compare0_set(rtc1_counter_get()); + nrf_delay_us(100); + timer_timeouts_check_sched(); ... but still same issue&lt;/p&gt;
&lt;p&gt;actually, the issue is not necessarily that it fires twice on the same timer, but that all remaining timer are considered as if timeout is 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: timer events triggered in a row</title><link>https://devzone.nordicsemi.com/thread/107868?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2017 10:13:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d88b5df-8360-455e-9962-b52948dcd97b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;This is a possible issue in app_timer.c, that can cause the timeout handler to execute two times in a row. This has been fixed in later SDK. The workaround you can try:&lt;/p&gt;
&lt;p&gt;Add a delay of 100us after timer_timeouts_check_sched() in compare_reg_update(), like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void compare_reg_update(app_timer_id_t timer_id_head_old)
{
...
    timer_timeouts_check_sched();
    nrf_delay_us(100); // Add this delay.
...
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,
Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>