<?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>Regarding timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71321/regarding-timer</link><description>Hello 
 I am developing a firmware for nrf52832 using buttons like if I continuosly press my button for 6 seconds it will go to active mode from sleep mode and have been using app_timer example for second generation is there any alternate way to genrate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Feb 2021 10:09:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71321/regarding-timer" /><item><title>RE: Regarding timer</title><link>https://devzone.nordicsemi.com/thread/293277?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 10:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b183a5-d424-4c7f-aa8e-c57cf2ec2d26</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. If you want to keep the total amount of code as low as possible, then doing things as low-level as possible will achieve that. That is typically not a requirement, though. A more common approach is where you want to keep your application code as simple and minimal, and achieve that by using higher level libraries that provide functionality you need. That is what you get by using the app_timer library, as I see you do here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding timer</title><link>https://devzone.nordicsemi.com/thread/293189?ContentTypeID=1</link><pubDate>Sat, 06 Feb 2021 03:40:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab181b22-0f43-44d8-b613-43e7d177829f</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;I want to make this code as minimal as possible&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks and regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;manikandan v&lt;pre class="ui-code" data-mode="c_cpp"&gt;void process_button(uint32_t button_name, uint32_t action){

//    sd_nvic_SystemReset();
#if NRF52832 == 1
    if(button_name == SW1 &amp;amp;&amp;amp; coaster_config_data.snooze_enabled){
        if(sleep_mode){
            app_timer_stop(long_press_timer);
            ret_code_t err = app_timer_start(long_press_timer, SIX_SECONDS, (void *)WAKE_UP);
            APP_ERROR_CHECK(err);
        }
        else{
            snooze_present_mems();
            five_min_counter = coaster_config_data.snoozer_timer_interval / 5;
            turn_off_buzzer = true;
            app_timer_stop(snooze_timer);
            app_timer_start(snooze_timer, APP_TIMER_TICKS(5*60*1000), NULL);
        }
    }
    else if(button_name == SW2){
        printf(&amp;quot;SW2\n&amp;quot;);
        if(!timer_started &amp;amp;&amp;amp; !sleep_mode){
            timer_started = true;
            ret_code_t err = app_timer_start(long_press_timer, SIX_SECONDS, (void *)LONG_PRESS);
            APP_ERROR_CHECK(err);
        }
        ++count_for_long_press;
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Regarding timer</title><link>https://devzone.nordicsemi.com/thread/293073?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 11:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd354f91-5dc2-49a4-a603-437f261ede0a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Manikandan ,&lt;/p&gt;
&lt;p&gt;There are other alternatives than using the app_timer, typically using an RTC directly or using a TIMER (though with a high current consumption as a result). The app_timer is probably the best to use for this though. Why do you want an alternative?&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>