#error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 )\r
#endif\r
\r
-/* Used to check non ISR safe API functions are not called from inside an\r
-ISR. */\r
-#define portASSERT_IF_IN_INTERRUPT() configASSERT( ( portICCRPR_RUNNING_PRIORITY_REGISTER == 0xffUL ) || ( portICCRPR_RUNNING_PRIORITY_REGISTER == portLOWEST_INTERRUPT_PRIORITY ) )\r
-\r
/* Some vendor specific files default configCLEAR_TICK_INTERRUPT() in\r
portmacro.h. */\r
#ifndef configCLEAR_TICK_INTERRUPT\r
\r
void vPortEnterCritical( void )\r
{\r
- /* This is not the interrupt safe version of the enter critical function.\r
- Only API functions that end in "FromISR" can be used in an interrupt. */\r
- portASSERT_IF_IN_INTERRUPT();\r
-\r
/* Mask interrupts up to the max syscall interrupt priority. */\r
ulPortSetInterruptMask();\r
\r
directly. Increment ulCriticalNesting to keep a count of how many times\r
portENTER_CRITICAL() has been called. */\r
ulCriticalNesting++;\r
+\r
+ /* This is not the interrupt safe version of the enter critical function.\r
+ Only API functions that end in "FromISR" can be used in an interrupt. The\r
+ test of ulCriticalNesting() guards against recursive calls to assert in the\r
+ case that assert itself contains a call to taskENTER_CRITICAL. */\r
+ if( ulCriticalNesting == 1 )\r
+ {\r
+ configASSERT( ulPortInterruptNesting == 0 );\r
+ }\r
}\r
/*-----------------------------------------------------------*/\r
\r
void vPortExitCritical( void )\r
{\r
- /* This is not the interrupt safe version of the enter critical function.\r
- Only API functions that end in "FromISR" can be used in an interrupt. */\r
- portASSERT_IF_IN_INTERRUPT();\r
-\r
if( ulCriticalNesting > portNO_CRITICAL_NESTING )\r
{\r
/* Decrement the nesting count as the critical section is being\r