]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/Renesas/RX200/portmacro.h
Complete additions of portASSERT_IF_INTERRUPT_PRIORITY_INVALID() for all RX compiler...
[freertos] / FreeRTOS / Source / portable / Renesas / RX200 / portmacro.h
index 4c9c88e588abceccf10a67b5dab6a67594b9833b..721334a4866b3263d659f8da217e16f8c2699a89 100644 (file)
@@ -142,10 +142,15 @@ static void vPortYield( void )
 \r
 /*\r
  * These macros should be called directly, but through the taskENTER_CRITICAL()\r
- * and taskEXIT_CRITICAL() macros.\r
+ * and taskEXIT_CRITICAL() macros.  If the RTOS is being used correctly then\r
+ * the check to ensure the IPL is not being lowered will not be needed.  It is\r
+ * included to ensure assert()s triggered by using an incorrect interrupt\r
+ * priority do not result in the assert() handler inadvertently lowering the\r
+ * priority mask, and in so doing allowing the offending interrupt to continue\r
+ * triggering until stack space is exhausted.\r
  */\r
 #define portENABLE_INTERRUPTS()        set_ipl( 0 )\r
-#define portDISABLE_INTERRUPTS()       set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#define portDISABLE_INTERRUPTS()       if( get_ipl() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) set_ipl( ( unsigned char ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
 \r
 /* Critical nesting counts are stored in the TCB. */\r
 #define portCRITICAL_NESTING_IN_TCB ( 1 )\r