File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -372,3 +372,25 @@ void vPortClearInterruptMaskFromISR( UBaseType_t uxSavedStatusRegister )
372372#endif /* __mips_hard_float == 1 */
373373
374374/*-----------------------------------------------------------*/
375+
376+ __attribute__((always_inline )) static BaseType_t xPortIsInsideInterrupt ( void )
377+ {
378+ uint32_t ulCurrentInterrupt ;
379+ BaseType_t xReturn ;
380+
381+ /* Obtain the number of the currently executing interrupt. */
382+ __asm volatile ("mfc0 %0, $12" : "=r" (ulCurrentInterrupt ));
383+
384+ if ( ulCurrentInterrupt == 0 )
385+ {
386+ xReturn = pdFALSE ;
387+ }
388+ else
389+ {
390+ xReturn = pdTRUE ;
391+ }
392+
393+ return xReturn ;
394+ }
395+
396+ /*-----------------------------------------------------------*/
Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ extern void vPortClearInterruptMaskFromISR( UBaseType_t );
146146#define portSET_INTERRUPT_MASK_FROM_ISR () uxPortSetInterruptMaskFromISR()
147147#define portCLEAR_INTERRUPT_MASK_FROM_ISR ( uxSavedStatusRegister ) vPortClearInterruptMaskFromISR( uxSavedStatusRegister )
148148
149+ extern BaseType_t xPortIsInsideInterrupt ( void );
150+
149151#if ( __mips_hard_float == 0 ) && ( configUSE_TASK_FPU_SUPPORT == 1 )
150152 #error configUSE_TASK_FPU_SUPPORT can only be set to 1 when the part supports a hardware FPU module.
151153#endif
You can’t perform that action at this time.
0 commit comments