<?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 with MQTT simple smaple trouble</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60468/button-interrupt-with-mqtt-simple-smaple-trouble</link><description>Hi! 
 
 I am trying to merge the basic/button sample with the mqtt-simple sample. 
 I added to the prj.conf of mqtt-simple sample. 
 My main.c looks like this: 
 
 After merging, i added the &amp;quot;btn_pressed&amp;quot; flag as i read in the forum that individual use</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 May 2020 12:28:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60468/button-interrupt-with-mqtt-simple-smaple-trouble" /><item><title>RE: Button interrupt with MQTT simple smaple trouble</title><link>https://devzone.nordicsemi.com/thread/247862?ContentTypeID=1</link><pubDate>Mon, 04 May 2020 12:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccedf373-3408-44bf-a0d5-a1e6ecc138e5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Check out:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/hw_power_supply.html"&gt;https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/hw_power_supply.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button interrupt with MQTT simple smaple trouble</title><link>https://devzone.nordicsemi.com/thread/246456?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2020 10:18:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abc4ef0d-7c79-43e5-b762-3b328b53d2d1</guid><dc:creator>molviken</dc:creator><description>&lt;p&gt;That worked, thank you! Another quick question, is there a way to bypass the debugger IC to power the board from a power bank?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button interrupt with MQTT simple smaple trouble</title><link>https://devzone.nordicsemi.com/thread/246029?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2020 12:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d4724e6-ac58-4205-94bf-d437360e3a66</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think you can use workqueue here instead of using a global btn_pressed flag:&lt;br /&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/threads/workqueue.html?highlight=workqueue"&gt;http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/threads/workqueue.html?highlight=workqueue&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That way you can add&amp;nbsp;&lt;span&gt;data_publish() the the&lt;/span&gt;&amp;nbsp;workqueue thread from the&amp;nbsp;button_pressed() handler.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>