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

Marian Buschsieweke notifications at github.com
Thu Mar 14 07:31:45 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

It seems I was wrong again. On AVR interrupts *can* interrupt an ISR. But upon serving an interrupt the AVR unsets the interrupt enable bit. Reenabling interrupts during ISR would allow getting interrupted. The problem for AVRs is that they are particularly short on ROM and slow, so that the stack on which the state to resume on after the ISR is stored easily overflows. Thus, it was decided to disable interrupts during ISR by default. This also means that on the AVR the trivial implementation would behave as expected.

-- 
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_r265434162
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190313/68467b6e/attachment.html>


More information about the notifications mailing list