<?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>While loop not terminating, but the event handler is called.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42179/while-loop-not-terminating-but-the-event-handler-is-called</link><description>Hi, 
 
 I&amp;#39;m trying to run a display using SPI, and I&amp;#39;ve run into some troubles. I&amp;#39;ve attached my code below: 
 
 My issue is that the program never gets past the while loop (&amp;quot;done&amp;quot; is never logged). The event handler however, is called (&amp;quot;Transfer complete</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Jan 2019 00:23:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42179/while-loop-not-terminating-but-the-event-handler-is-called" /><item><title>RE: While loop not terminating, but the event handler is called.</title><link>https://devzone.nordicsemi.com/thread/164125?ContentTypeID=1</link><pubDate>Mon, 07 Jan 2019 00:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4111986d-5187-4496-9e73-0e89741ce066</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;No, the handler was called - but the function never returned.&lt;/p&gt;
&lt;p&gt;This is what I meant with dead loop - you cannot wait for another interrupt inside an interupt handler with the same (or higher) priority.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop not terminating, but the event handler is called.</title><link>https://devzone.nordicsemi.com/thread/164117?ContentTypeID=1</link><pubDate>Sun, 06 Jan 2019 17:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9cfec55-ef48-4ea1-a120-deecb2ffd69c</guid><dc:creator>freelon</dc:creator><description>&lt;p&gt;Thank you so much! Everything works as expected now! Do you know why uncommenting the logging in the while loop caused the event handler to not be called? Is it the same reason - the flush?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: While loop not terminating, but the event handler is called.</title><link>https://devzone.nordicsemi.com/thread/164112?ContentTypeID=1</link><pubDate>Sun, 06 Jan 2019 12:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c81c38b-5cfd-4fc0-bb1a-dea575d0cceb</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;NRF_LOG_FLUSH() inside the SPI event handler can hang (dead loop), because that will be called in interrupt context and waits for interrupts internally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>