/*\r
- FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+ FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
/* Demo app include files. */\r
#include "recmutex.h"\r
\r
-/* Priorities assigned to the three tasks. */\r
-#define recmuCONTROLLING_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
+/* Priorities assigned to the three tasks. recmuCONTROLLING_TASK_PRIORITY can\r
+be overridden by a definition in FreeRTOSConfig.h. */\r
+#ifndef recmuCONTROLLING_TASK_PRIORITY\r
+ #define recmuCONTROLLING_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
+#endif\r
#define recmuBLOCKING_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define recmuPOLLING_TASK_PRIORITY ( tskIDLE_PRIORITY + 0 )\r
\r
/* Misc. */\r
#define recmuSHORT_DELAY ( 20 / portTICK_RATE_MS )\r
#define recmuNO_DELAY ( ( portTickType ) 0 )\r
-#define recmuTHREE_TICK_DELAY ( ( portTickType ) 3 )\r
+#define recmuFIVE_TICK_DELAY ( ( portTickType ) 5 )\r
\r
/* The three tasks as described at the top of this file. */\r
static void prvRecursiveMutexControllingTask( void *pvParameters );\r
long enough to ensure the polling task will execute again before the\r
block time expires. If the block time does expire then the error\r
flag will be set here. */\r
- if( xSemaphoreTakeRecursive( xMutex, recmuTHREE_TICK_DELAY ) != pdPASS )\r
+ if( xSemaphoreTakeRecursive( xMutex, recmuFIVE_TICK_DELAY ) != pdPASS )\r
{\r
xErrorOccurred = pdTRUE;\r
}\r
}\r
\r
/* Having given it back the same number of times as it was taken, we\r
- should no longer be the mutex owner, so the next give sh ould fail. */\r
+ should no longer be the mutex owner, so the next give should fail. */\r
if( xSemaphoreGiveRecursive( xMutex ) == pdPASS )\r
{\r
xErrorOccurred = pdTRUE;\r
stall can be detected. */\r
uxControllingCycles++;\r
\r
- /* Suspend ourselves to the blocking task can execute. */\r
+ /* Suspend ourselves so the blocking task can execute. */\r
xControllingIsSuspended = pdTRUE;\r
vTaskSuspend( NULL );\r
xControllingIsSuspended = pdFALSE;\r
\r
#if( INCLUDE_uxTaskPriorityGet == 1 )\r
{\r
+ /* Check priority inherited. */\r
configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY );\r
}\r
#endif /* INCLUDE_uxTaskPriorityGet */\r
{\r
xErrorOccurred = pdTRUE;\r
}\r
+\r
+ #if( INCLUDE_uxTaskPriorityGet == 1 )\r
+ {\r
+ /* Check priority disinherited. */\r
+ configASSERT( uxTaskPriorityGet( NULL ) == recmuPOLLING_TASK_PRIORITY );\r
+ }\r
+ #endif /* INCLUDE_uxTaskPriorityGet */\r
}\r
}\r
\r