portable/ARM_CM0: Add xPortIsInsideInterrupt

Add missing xPortIsInsideInterrupt function to Cortex-M0 port.
This commit is contained in:
Paul Bartell 2023-04-18 14:43:29 -07:00 committed by Paul Bartell
parent 714e543247
commit 5f19e34f87
3 changed files with 111 additions and 5 deletions

View file

@ -120,6 +120,41 @@ extern void vClearInterruptMaskFromISR( uint32_t ulMask );
#define portNOP()
#define portINLINE __inline
#ifndef portFORCE_INLINE
#define portFORCE_INLINE __forceinline
#endif
/*-----------------------------------------------------------*/
static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt( void )
{
uint32_t ulCurrentInterrupt;
BaseType_t xReturn;
/* Obtain the number of the currently executing interrupt. */
__asm
{
/* *INDENT-OFF* */
mrs ulCurrentInterrupt, ipsr
/* *INDENT-ON* */
}
if( ulCurrentInterrupt == 0 )
{
xReturn = pdFALSE;
}
else
{
xReturn = pdTRUE;
}
return xReturn;
}
/*-----------------------------------------------------------*/
/* *INDENT-OFF* */
#ifdef __cplusplus
}