<?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>Handling for Interrupt</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/57171/handling-for-interrupt</link><description>Hello Sir, 
 I would like to ask about the handling of the interruption in the nRF52 SDK. 
 The versions for SDK and SoftDevice are 15.3.0 and S132 v6.1.1 
 In the processing of &amp;quot;nrfx_gpiote_irq_handler&amp;quot;(modules/nrfx/drivers/src/nrfx_gpiote.c), it seems</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jan 2020 14:39:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/57171/handling-for-interrupt" /><item><title>RE: Handling for Interrupt</title><link>https://devzone.nordicsemi.com/thread/231936?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 14:39:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adc26f68-75eb-4bf1-8f7b-61289b9e5419</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="tama"]Is it right recognition that &amp;quot;gpiote_event_handler&amp;quot; in the &amp;quot;app_button.c&amp;quot; is enough short in the IRQ handler.[/quote]
&lt;p&gt;I am not entirely sure about the question, but yes. Unless you do something that takes a &lt;em&gt;long&lt;/em&gt; time in the event handler, there should not be any problems. Particularly for button presses (which are extremely slow in this context).&lt;/p&gt;
[quote user="tama"]Does it mean that there is no interrupt processing in the multiplex and &lt;br /&gt;the second interrupt processing will be in the pending state in the hardware?[/quote]
&lt;p&gt;If another interrupt occurs on a different IRQ number (of same or lower priority), that will be pending and will be serviced once the current interrupt is processed. But you cannot &amp;quot;queue&amp;quot; multiple interrupts for the same IRQ number. That is rarely a practical problem, though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling for Interrupt</title><link>https://devzone.nordicsemi.com/thread/231816?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 09:37:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bf90313-3512-488e-9a07-9a80fcf006c3</guid><dc:creator>tama</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you very much. I would like to ask about your answer.&lt;/p&gt;
&lt;p&gt;&amp;gt;You can lose interrupts if&amp;nbsp;multiple occur &lt;em&gt;very&lt;/em&gt; fast (faster than it takes to process the interrupts).&lt;/p&gt;
&lt;p&gt;&amp;gt;There is no way around &amp;gt;this issue though, other than making sure that the code executed&lt;/p&gt;
&lt;p&gt;&amp;gt; in the IRQ handler is as short as possible (including &amp;gt;event handlers, etc. called from&lt;/p&gt;
&lt;p&gt;&amp;gt; it with the same priority).&lt;/p&gt;
&lt;p&gt;Is it right recognition that &amp;quot;gpiote_event_handler&amp;quot; in the &amp;quot;app_button.c&amp;quot; is enough short in the IRQ handler.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt;After performing the first interrupt processing, is it waited for the next interrupt processing&lt;/p&gt;
&lt;p&gt;&amp;gt;to be performed?&lt;/p&gt;
&lt;p&gt;&amp;gt;Yes.&lt;/p&gt;
&lt;p&gt;Does it mean that there is no interrupt processing in the multiplex and &lt;br /&gt;the second interrupt processing will be in the pending state in the hardware?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Manabu Tajima&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling for Interrupt</title><link>https://devzone.nordicsemi.com/thread/231799?ContentTypeID=1</link><pubDate>Thu, 30 Jan 2020 08:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:961e95c6-50d2-4abf-a16a-59d54f308111</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]In the processing of &amp;quot;nrfx_gpiote_irq_handler&amp;quot;(modules/nrfx/drivers/src/nrfx_gpiote.c), it seems that interrupts are not disabled during interrupt processing for one pin.[/quote]
&lt;p&gt;The interrupt is not &lt;em&gt;disabled&lt;/em&gt; in the ISR, but that would usually not make sense either. However, it is &lt;em&gt;cleared&lt;/em&gt; by a call to&amp;nbsp;nrf_gpiote_event_clear().&lt;/p&gt;
[quote user=""]In this case, if one pin is interrupted multiple times in a short time, does the callback &amp;quot;gpiote_event_handler&amp;quot;(components/libraries/button/app_button.c) called from&lt;br /&gt;&amp;nbsp;&amp;quot;nrfx_gpiote_irq_handler&amp;quot; work correctly?[/quote]
&lt;p&gt;Yes. You can lose interrupts if&amp;nbsp;multiple occur &lt;em&gt;very&lt;/em&gt; fast (faster than it takes to process the interrupts). There is no way around this issue though, other than making sure that the code executed in the IRQ handler is as short as possible (including event handlers, etc. called from it with the same priority).&lt;/p&gt;
[quote user=""]After performing the first interrupt processing, is it waited for the next interrupt processing to be performed?[/quote]
&lt;p&gt;Yes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>