#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
\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
configMAX_SYSCALL_INTERRUPT_PRIORITY.\r
\r
FreeRTOS maintains separate thread and ISR API functions to ensure\r
- interrupt entry is as fast and simple as possible.\r
+ interrupt entry is as fast and simple as possible. */\r
\r
- The following links provide detailed information:\r
- http://www.freertos.org/RTOS-Cortex-M3-M4.html\r
- http://www.freertos.org/FAQHelp.html */\r
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );\r
\r
/* Priority grouping: The interrupt controller (GIC) allows the bits\r
#endif /* configASSERT_DEFINED */\r
/*-----------------------------------------------------------*/\r
\r
+\r
+\r