<?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 function crashing the advertsing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9842/button-function-crashing-the-advertsing</link><description>Hello everyone 
 i want to create button fucntion press the button for 3 seconds and then it has to start advertsing but i have excuted the button fucntion but it si showing some errors in gpiote files so any suggestion or ideas will be helpful for me</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Feb 2016 08:25:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9842/button-function-crashing-the-advertsing" /><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36540?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2016 08:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22b5e5c-5574-4ede-bcf1-96351864e793</guid><dc:creator>karan</dc:creator><description>&lt;p&gt;Hello prabhudurai did you manage get your result&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36539?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 15:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d021b2-277f-4ec3-b4e6-148f2c905fe6</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Can you put your project files in a zip-file and upload them?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36538?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 14:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86cf61ae-9932-4c48-9da0-d6026e487930</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;thank you so much for your suggestions but the device is advertsing continously and it is not responding the APP ADV INTERVAL fucntions&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36537?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 14:00:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecabffdf-2f06-4e38-a01c-0b8ba831bb5d</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;yeah i ahve added all the necessaty imers but i am not able to find where i am going wrong can you guide me and verify my code and tell me  exactly what i have to do and where i have to do because its really bit confusing for me&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36536?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 13:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b264c0e-d310-4cb0-9cbc-8dba0617d6c0</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;The app timer library uses timers. Try to initiate and create your timers before you initiate and enable the buttons.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36535?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 13:36:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44789c0e-84a2-4fc0-98b3-4c8fa160c61d</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;Hello martin i have attached the updated program int he main. c file , if i add the button fucntion in the main program then board is not advertsing but if i remove that function it is advertising can you verify my program what i went wrong in that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36533?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 08:55:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e31a7567-c0a5-46e8-b660-1384ca9d032c</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;static void timer_handler(void * p_context)
{
if(!nrf_gpio_pin_read(BUTTON_1))
nrf_gpio_pin_toggle(LED_1);  // Toggle LED 1 if button 1 is still pressed
else
if(!nrf_gpio_pin_read(BUTTON_2))
nrf_gpio_pin_toggle(LED_2); // Toggle LED 2 if button 2 is still pressed
nrf_gpio_pin_clear(LED_1);
}&lt;/p&gt;
&lt;p&gt;I can able to amanage now if press the button 1 for 3, sec LED 1 is turned on and if i press the button 2 for 5 sec thent he LED 2 is turned on but i am trying to clear the LED 1 when button 2 is pressed for 5 sec but it is not getting cleared i dont know why can you tell me what i need to change in the handler function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36534?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 08:10:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7ddb1a6-50ee-4e94-95d5-8e3394fed0e8</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;Thank you so much for your help but i am trying to use  only one button for both actions like press the button for three secondds then LED 1 turn on and  press the same button for 5 sec it will turn off the LED so instead of two button configuration what can i modify to use one button can you suggest me? because am new to this part&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36532?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 07:23:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ee65e5f-bd5b-41a6-966e-2cd8820f50d4</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I modified your code and made a very basic example for you. It starts a single-shot timer when you push a button. When the timer event occurs after 3 seconds the application checks whether the button is still pressed and lights a LED accordingly. See comments in code marked with &amp;quot;NORDIC&amp;quot;.
You can add another timer that can turn off the LED for after 5 seconds.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/button_2D00_triggering_2D00_timer.zip"&gt;Example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Updated example that starts advertising after 3 second push and stops advertising after 5 second push.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8463.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt; Exmple with buttons and ble advertising:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4237.main.c"&gt;ble-button-timer.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36531?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 10:30:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd8faa80-1c4f-4ac7-a12e-631adccae5df</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;yes am using the sdk version 9 and the button example  now i am able to succed to see the button example workign very well can you suggest how to set the timer for 3 sec in the button example because i want to create the function like if i press the button for 3 sec led turn on and if i press the same button for 5 sec then  the LED should turned off&lt;/p&gt;
&lt;p&gt;I ahve attached my main.c file in this post&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36530?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 10:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6001e37-ba60-4513-ba1a-ce4513af50cc</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Have you remembered to program a softdevice onto your board? What SDK and/or example are you basing your code on? Maybe you can post your code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36529?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 10:01:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ef1c2da-1ba3-46a9-b76f-eda115e7d45a</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;i have changed all the those things which was suggested by you after that ,it is getting compiled and no errors but i didnot get any responses from the board do i ahve to included any neccessary header files?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36528?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 09:28:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50667aae-84a6-40cf-b1a2-89bb3f2379ae</guid><dc:creator>MARTIN FR</dc:creator><description>&lt;p&gt;i have added the nrf_drv_gpiote.c /app_gpiote.c files then it is showing this errors  GPIOTE IRQ HANDLER multiply defined&lt;/p&gt;
&lt;p&gt;if i change the GIPOTE _ENABLED 1 then the softdevice part showign some errors also and i cannot able to load the program into the KIT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: button function crashing the advertsing</title><link>https://devzone.nordicsemi.com/thread/36527?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 09:17:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff8cd071-46da-4304-ab00-fb077c1a80cf</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;It would help if you also post what the errors say. If I am to guess what causes your errors then maybe you have forgot to enable the GPIOTE module by changing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define GPIOTE_ENABLED 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define GPIOTE_ENABLED 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in the nrf_drv_config.h file found in the folder &amp;quot;&lt;em&gt;your_project_folder/config&lt;/em&gt;&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>