]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/IAR/ARM_CA9/port.c
Default the definition of portASSERT_IF_IN_ISR() to nothing if it is not defined.
[freertos] / FreeRTOS / Source / portable / IAR / ARM_CA9 / port.c
index fc23dcd0ed1d78a1bbb3254bef75f6a5d6e3d171..674aab9a15cbce3094b7a7bda32e8e08ac14c3b8 100644 (file)
@@ -315,6 +315,16 @@ void vPortEnterCritical( void )
        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 so\r
+       assert() if it is being called from an interrupt context.  Only API \r
+       functions that end in "FromISR" can be used in an interrupt.  Only assert if\r
+       the critical nesting count is 1 to protect against recursive calls if the\r
+       assert function also uses a critical section. */\r
+       if( ulCriticalNesting == 1 )\r
+       {\r
+               configASSERT( ulPortInterruptNesting == 0 );\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r