<?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>App timer issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66642/app-timer-issues</link><description>Hello everyone, 
 
 I&amp;#39;ve got strange behavior coming out of my app timer. 
 I&amp;#39;m using the timer to periodically turn on or off some LED&amp;#39;s and since each LED pattern is different I want to incorporate a counter to set different stages of my pattern. 
</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Oct 2020 06:46:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66642/app-timer-issues" /><item><title>RE: App timer issues</title><link>https://devzone.nordicsemi.com/thread/273080?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 06:46:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef78077f-fe0a-4ffc-8633-dcea334a2824</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hehe, this happens to everyone. Nevertheless, good that you found the root cause and returned with the solution.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Jared&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer issues</title><link>https://devzone.nordicsemi.com/thread/273012?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 13:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7bc4c53-cfa8-411b-a6cc-87dcb7a9bf27</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Apparently I cannot code properly, I&amp;#39;ve found the issue and its stupid.&lt;/p&gt;
&lt;p&gt;Writing outside of an array causes the variable to reset.&lt;/p&gt;
&lt;p&gt;I changed my code so it isn&amp;#39;t able to write outside of the array and it works okay now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer issues</title><link>https://devzone.nordicsemi.com/thread/273004?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 13:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:396bd831-6b79-4b74-852f-4ae7a76ea538</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;SDK 15.0.0, sorry I forgot to mention.&lt;/p&gt;
&lt;p&gt;No I do not set the counter to 0 anywhere else, the counter is declared static inside the event handler.&lt;/p&gt;
&lt;p&gt;Disabling the other timer doesn&amp;#39;t make a difference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;At the end of the handler the value is already reset back to 0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added breakpoints and screen captures of the action.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905057233v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905096824v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905128884v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905149988v4.png" /&gt;&lt;/p&gt;
&lt;p&gt;And when the function is called again:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905182531v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1601905198626v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Even if I declare the counter variable outside of the function it doesn&amp;#39;t help.&lt;/p&gt;
&lt;p&gt;For some reason it seems that it doesn&amp;#39;t want to store the value even though it is static.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: App timer issues</title><link>https://devzone.nordicsemi.com/thread/272994?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 13:17:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f322fee-d91b-4cea-8dd3-9ae09a70cd22</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;What SDK version are you using?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Are you setting the counter to 0 any other place in your code? Could you set a breakpoint right after the program steps out of the handler, is counter reset already then? What priority are you running the module at? Could you try disabling the second timer, does it makes a difference?&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></channel></rss>