diff --git a/portable/MPLAB/PIC32MZ/port.c b/portable/MPLAB/PIC32MZ/port.c index f9a88fb60..9d179335e 100644 --- a/portable/MPLAB/PIC32MZ/port.c +++ b/portable/MPLAB/PIC32MZ/port.c @@ -382,7 +382,7 @@ portFORCE_INLINE BaseType_t xPortIsInsideInterrupt( void ) /* Obtain the number of the currently executing interrupt. */ __asm volatile("mfc0 %0, $12" : "=r" (ulCurrentInterrupt)); - if( ulCurrentInterrupt == 0 ) + if( ( ulCurrentInterrupt && portEXL_BIT ) != 0U ) { xReturn = pdFALSE; }