#include "FreeRTOS.h"\r
#include "task.h"\r
\r
+static unsigned portLONG ulCriticalNesting = 0x9999UL;\r
+\r
\r
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )\r
{\r
\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
+ ulCriticalNesting = 0UL;\r
}\r
/*-----------------------------------------------------------*/\r
\r
void vPortEndScheduler( void )\r
{\r
}\r
-/*-----------------------------------------------------------*/
\ No newline at end of file
+/*-----------------------------------------------------------*/\r
+\r
+void vPortEnterCritical( void )\r
+{\r
+ portDISABLE_INTERRUPTS();\r
+ ulCriticalNesting++;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortExitCritical( void )\r
+{\r
+ ulCriticalNesting--;\r
+ if( ulCriticalNesting == 0 )\r
+ {\r
+ portENABLE_INTERRUPTS();\r
+ }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned portBASE_TYPE uxPortSetInterruptMaskFromISR( void )\r
+{\r
+ return 0;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE uxSavedInterruptMask )\r
+{\r
+}\r
+\r
+\r
+\r
+\r
+\r
#define portENTER_CRITICAL() vPortEnterCritical()\r
#define portEXIT_CRITICAL() vPortExitCritical()\r
\r
-extern unsigned portBASE_TYPE uxPortSetInterruptMaskFromISR();\r
+extern unsigned portBASE_TYPE uxPortSetInterruptMaskFromISR( void );\r
extern void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE );\r
#define portSET_INTERRUPT_MASK_FROM_ISR() uxPortSetInterruptMaskFromISR()\r
#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusRegister ) vPortClearInterruptMaskFromISR( uxSavedStatusRegister )\r