<?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>Does SEV() clear or set the Event register?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10522/does-sev-clear-or-set-the-event-register</link><description>Does SEV() clear or set the Event register?
and why do we use it between two WFE() calls? 
 __WFE(); 
__SEV();
__WFE();</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Dec 2015 08:50:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10522/does-sev-clear-or-set-the-event-register" /><item><title>RE: Does SEV() clear or set the Event register?</title><link>https://devzone.nordicsemi.com/thread/39141?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2015 08:50:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2eff0d6-6cae-4f8c-b962-a0bd7bd73345</guid><dc:creator>Radoslaw Koppel</dc:creator><description>&lt;p&gt;Please see also my comment here: &lt;a href="https://devzone.nordicsemi.com/question/1555/how-do-you-put-the-nrf51822-chip-to-sleep/?comment=60256#comment-60256"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;
Think twice when are you clearing event flag - the safe place for that operation really depends on the requirements and code itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does SEV() clear or set the Event register?</title><link>https://devzone.nordicsemi.com/thread/39140?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 11:00:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:029a08d9-b331-4c06-8e22-8ed81ce49ea2</guid><dc:creator>KnightYusuf</dc:creator><description>&lt;p&gt;now i understand it&amp;#39;s sev()+wfe() that clears the event register not sev() only, thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Does SEV() clear or set the Event register?</title><link>https://devzone.nordicsemi.com/thread/39139?ContentTypeID=1</link><pubDate>Fri, 27 Nov 2015 10:33:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4021e20-12cd-4bb4-be6d-f6f2e16ce9c8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Update: Corrected answer.&lt;/p&gt;
&lt;p&gt;Yes. SEV signals an event. WFE, on the other hand, will put the CPU to sleep and wait for an event, then wake up and clear the event. If&amp;nbsp;the event was already set, WFE will clear the event and return it immediately.&lt;/p&gt;
&lt;p&gt;This way of using two WFE calls is a power-optimization. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/49010/methods-to-put-the-nrf52-to-sleep-in-a-spinlock-loop"&gt;this thread&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/question/58088/nrf51422-wont-sleep/?answer=58214#post-id-58214"&gt;this post&lt;/a&gt;&amp;nbsp;for details.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;
&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>