<?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>Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10721/button-interrupt-problem-when-booting</link><description>Dear, 
 I&amp;#39;m now face problem on button interrupt. 
 I use 3 buttons for my system. 
 button 2, 3 is used for boot diagnostics. assigned as below. 
 bsp_event_to_button_action_assign(0,
 BSP_BUTTON_ACTION_PUSH,
 BSP_EVENT_KEY_0);

 bsp_event_to_button_action_assign</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Dec 2015 12:25:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10721/button-interrupt-problem-when-booting" /><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40051?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2015 12:25:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4b57198-119d-4322-a0cc-45147676e39f</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;There is no example in the SDK, but I edited the answer with some ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40050?ContentTypeID=1</link><pubDate>Fri, 11 Dec 2015 00:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b2ee0e2-03a6-490a-b2c2-76a556319295</guid><dc:creator>ratharn</dc:creator><description>&lt;p&gt;Thank you for answer!&lt;/p&gt;
&lt;p&gt;Is there any example using app_button fuction?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40049?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 10:14:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2143ec0d-fee3-43c9-87f8-9b5b19f0bfbf</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The way the bsp module is made, button ID is not the same as the gpio number. Rather button ID 0 corresponds to BSP_BUTTON_0/BUTTON_1, ID 1 to BSP_BUTTON_1/BUTTON_2 and so on. So this should work:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;//BTN_ID_U corresponds to BUTTON_2 which equals BSP_BUTTON_1 which has ID 1
bsp_event_to_button_action_assign(1,
                                             BSP_BUTTON_ACTION_RELEASE,
                                             BSP_EVENT_KEY_1);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I would not recommend however to use the bsp module, use app_button instead.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 11.12.2015:&lt;/strong&gt;
Here is some example code using app_button:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NUM_OF_BUTTONS 2

static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    //code run on button state change
}

//Configure 2 buttons with pullup and detection on low state
static const app_button_cfg_t app_buttons[NUM_OF_BUTTONS] = 
{
    {BUTTON_1, false, BUTTON_PULL, button_event_handler},
    {BUTTON_2, false, BUTTON_PULL, button_event_handler},
};

int main(void)
{
    //start LFCLK, if SoftDevice is used this is started in sd_ble_enable
    NRF_CLOCK-&amp;gt;LFCLKSRC            = (CLOCK_LFCLKSRC_SRC_Xtal &amp;lt;&amp;lt; CLOCK_LFCLKSRC_SRC_Pos);
    NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK-&amp;gt;TASKS_LFCLKSTART    = 1;

    while (NRF_CLOCK-&amp;gt;EVENTS_LFCLKSTARTED == 0)
    {
        // Do nothing.
    }
   
    //app_button uses app_timer, if this is not initialize, then initialize it here
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);

    //init app_button module, 50ms detection delay (button debouncing)
    err_code = app_button_init((app_button_cfg_t *)app_buttons,
                                   NUM_OF_BUTTONS,
                                   APP_TIMER_TICKS(50, APP_TIMER_PRESCALER));
    APP_ERROR_CHECK(err_code);

    err_code = app_button_enable();
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;;)
    {

    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40048?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2015 06:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ac02e83-5101-49f6-bd80-1cbca86bb07e</guid><dc:creator>ratharn</dc:creator><description>&lt;p&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BUTTON_2       7
#define BUTTON_3       21
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;so GPIO 7 &amp;amp; 21 used for button 2,3&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40046?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 13:04:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1902fde2-acc7-443a-8f12-3d598d4e0d86</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;So BTN_ID_U is the number 2 or BUTTON_2 (which is actually the number 18)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40047?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 08:36:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10d127f5-ea1a-4c18-9ab2-cf2ca860e414</guid><dc:creator>ratharn</dc:creator><description>&lt;p&gt;BTN_ID_U is button 2
BTN_ID_C is button 3&lt;/p&gt;
&lt;p&gt;thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button Interrupt problem when booting</title><link>https://devzone.nordicsemi.com/thread/40045?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 14:49:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b887d119-b9ff-4ebc-b18c-6af0442c52a8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;What is BTN_ID_U and BTN_ID_C?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>