<?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>gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22400/gpiote-handler---disable-momentarily-to-run-critical-section</link><description>With calls to these functions:
nrf_drv_gpiote_init()
nrf_drv_gpiote_in_init()
nrf_drv_gpiote_in_event_enable()
I have a handler (interrupt) routine that services a CAN bus chip on SPI bus. The handler runs when the chip&amp;#39;s interrupt output, connected</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Jun 2017 12:11:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22400/gpiote-handler---disable-momentarily-to-run-critical-section" /><item><title>RE: gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/thread/88102?ContentTypeID=1</link><pubDate>Tue, 06 Jun 2017 12:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0ee512e-fa28-4259-abcd-b30649de05ff</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, if there is an interrupt while it is momentarily disabled, the pending interrupt will run immediately when the interrupt is enabled again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/thread/88101?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2017 00:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96cc4825-ed81-41ed-8f2f-f8f03f30f388</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;So whilst the interrupt is momentarily disabled, if an event on the GPIO occurs the event will run immediately when the interrupt is enabled again?  Usually in a microprocessor an interrupt flag is set so the interrupt is pending and runs immediately when the interrupt are enabled again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/thread/88100?ContentTypeID=1</link><pubDate>Tue, 30 May 2017 06:31:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e93db784-099a-495f-aebd-ab9f985262a7</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, that looks like the right approach! I would think the easiest is to add a custom function to nrf_drv_gpiote.c/.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/thread/88099?ContentTypeID=1</link><pubDate>Tue, 30 May 2017 00:38:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe8b11ce-de42-4e97-af7d-8be622a1156b</guid><dc:creator>Peter</dc:creator><description>&lt;p&gt;Ok.  Sounds good.  What do suggest using for the mask argument in those functions?  Looks like use should be:
int32_t channel = (int32_t)channel_port_get(pin);
nrf_gpiote_int_disable(1 &amp;lt;&amp;lt; channel);
nrf_gpiote_int_enable(1 &amp;lt;&amp;lt; channel);
however channel_port_get(pin) is __STATIC_INLINE in a C file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: gpiote handler - disable momentarily to run critical section</title><link>https://devzone.nordicsemi.com/thread/88098?ContentTypeID=1</link><pubDate>Mon, 29 May 2017 08:47:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b586b5ad-a9d0-47f0-98b9-32bfdffe9fd7</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;If you want to disable and and then enable an interrupt, you can check if it works to use &lt;code&gt;nrf_gpiote_int_disable()&lt;/code&gt; and then &lt;code&gt;nrf_gpiote_int_enable()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>