<?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>nrf52832 zephyr, critical section disable system interrupts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76332/nrf52832-zephyr-critical-section-disable-system-interrupts</link><description>I am using an nrf52832 DK with Zephyr and I have a component that require a block of code to run uninterrupted. Specifically I am using HX711 with four load cells, and the serial protocol for reading needs protection from system interrupts. This is the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Jun 2021 10:10:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76332/nrf52832-zephyr-critical-section-disable-system-interrupts" /><item><title>RE: nrf52832 zephyr, critical section disable system interrupts</title><link>https://devzone.nordicsemi.com/thread/315343?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 10:10:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b56c09d-0f76-494a-997c-f405da7bb2b5</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It seems like using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/zephyr/reference/kernel/other/interrupts.html#c.irq_lock"&gt;irq_lock()&lt;/a&gt;/&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/zephyr/reference/kernel/other/interrupts.html#c.irq_unlock"&gt;irq_unlock()&lt;/a&gt;&amp;nbsp;is the correct way to go about disabling interrupts. Check out the section&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/zephyr/reference/kernel/other/interrupts.html#preventing-interruptions"&gt;Preventing Interrupts&lt;/a&gt;&amp;nbsp;for more information about these calls, e.g. the locking only applies for the calling thread.&amp;nbsp;The section also presents another approach: Disabling specific IRQs.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52832 zephyr, critical section disable system interrupts</title><link>https://devzone.nordicsemi.com/thread/315222?ContentTypeID=1</link><pubDate>Mon, 14 Jun 2021 16:51:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3829874b-6921-4783-8941-3cc480f9883b</guid><dc:creator>yayembedded</dc:creator><description>&lt;p&gt;I did some more experimenting and I have surrounded my critical section code with irq_lock() and irq_unlock()&lt;/p&gt;
&lt;p&gt;Is that enough to accomplish what I was looking for?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>