1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Interrupt cleanup

Fixes issue of reentrant calls to nointerrupts()
exposed functional replacements to cli sei and SREG when dealing with
interrupts
InterruptLock class to auto stop and restore interrupt level
Fix user ISR calls to be like Arduino with interrupts disabled fully.
This commit is contained in:
Makuna
2015-08-03 19:35:17 -07:00
parent 8e09520501
commit 57642c10b6
5 changed files with 58 additions and 18 deletions

View File

@ -65,8 +65,8 @@ inline bool ETS_INTR_WITHINISR()
{
uint32_t ps;
__asm__ __volatile__("rsr %0,ps":"=a" (ps));
// PS.EXCM bit check
return ((ps & (1 << 4)) != 0);
// PS.INTLEVEL check
return ((ps & 0x0f) != 0);
}
inline uint32_t ETS_INTR_ENABLED(void)