I reported the bug just now. It’s at
Now I have to figure out how to handle critical sections.
For now, just two functions–di() and ei(). They will use a global variable uint8_t interruptDisableReferenceCount. If it’s 0, interrupts are enabled. It will initialize to 1.
I also dealt with the __interrupt bug where it doesn’t generate ei before reti.
Here is my interrupt.c file for now:
I have also purged __critical from my code and placed di() and ei() where I need it.