]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/recmutex.c
Update FreeRTOS version number to V7.5.3
[freertos] / FreeRTOS / Demo / Common / Minimal / recmutex.c
index bce86e10711baddd98310f0a634e9b7d5a89ad20..3ddc0d0ee089dcaa344fc68be513ef503c74792a 100644 (file)
@@ -1,5 +1,6 @@
 /*\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
@@ -191,7 +195,7 @@ unsigned portBASE_TYPE ux;
                        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
@@ -222,7 +226,7 @@ unsigned portBASE_TYPE ux;
                }\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
@@ -232,7 +236,7 @@ unsigned portBASE_TYPE ux;
                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
@@ -347,6 +351,7 @@ static void prvRecursiveMutexPollingTask( void *pvParameters )
 \r
                                #if( INCLUDE_uxTaskPriorityGet == 1 )\r
                                {\r
+                                       /* Check priority inherited. */\r
                                        configASSERT( uxTaskPriorityGet( NULL ) == recmuCONTROLLING_TASK_PRIORITY );\r
                                }\r
                                #endif /* INCLUDE_uxTaskPriorityGet */\r
@@ -363,6 +368,13 @@ static void prvRecursiveMutexPollingTask( void *pvParameters )
                                {\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