portDISABLE_INTERRUPTS()
masks interrupts only up to a certain priority. Priorities higher than a specific threshold (that you control) are not masked by portDISABLE_INTERRUPTS()
. See configMAX_SYSCALL_INTERRUPT_PRIORITY
, and don’t forget about how the priority number has an inverse relationship with the priority. Lower numbers are higher priorities. That’s why your priority-0 interrupt occurs even with interrupts “disabled”.