[riot-notifications] [RIOT-OS/RIOT] core: add irq_is_enabled() function to irq interface (#11117)

Marian Buschsieweke notifications at github.com
Wed Mar 13 20:29:00 CET 2019


maribu commented on this pull request.



> @@ -60,6 +61,14 @@ unsigned irq_enable(void);
  */
 void irq_restore(unsigned state);
 
+/**
+ * @brief   Test if IRQs are currently enabled
+ *
+ * @return  0 (false) if IRQs are currently disabled
+ * @return  != 0 (true) if IRQs are currently enabled

I just learned that Interrupts on ARM can be interrupted by another interrupt if configured that way. I was aware that ARM has a way cooler interrupt implementation that e.g. AVR and MSP430. But I'm surprised by how far more sophisticated their stuff is.

Keeping this in mind this really seems to be a pitfall. E.g. lets say my ISR wants to check wether it could be interrupted by another interrupt. I think this function should return false if not, and yes if it could be interrupted. Following that logic, on AVR this function should always return false in ISR context. Right?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11117#discussion_r265295844
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190313/736cae63/attachment-0001.html>


More information about the notifications mailing list