mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-11-09 13:12:33 -05:00
[Work In Progress] Adding the xPortIsInsideInterrupt to the PIC32MZ port
This commit is contained in:
parent
32e581636f
commit
9863019a0b
2 changed files with 24 additions and 0 deletions
|
|
@ -372,3 +372,25 @@ void vPortClearInterruptMaskFromISR( UBaseType_t uxSavedStatusRegister )
|
|||
#endif /* __mips_hard_float == 1 */
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
__attribute__((always_inline)) static BaseType_t xPortIsInsideInterrupt( void )
|
||||
{
|
||||
uint32_t ulCurrentInterrupt;
|
||||
BaseType_t xReturn;
|
||||
|
||||
/* Obtain the number of the currently executing interrupt. */
|
||||
__asm volatile("mfc0 %0, $12" : "=r" (ulCurrentInterrupt));
|
||||
|
||||
if( ulCurrentInterrupt == 0 )
|
||||
{
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue