]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/recmutex.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / Common / Minimal / recmutex.c
index 0741248f596146e6d0e25d696e1359f9f96751c6..e8625e689caf0496d03cc5692e689e79285d483b 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
@@ -119,9 +119,9 @@ be overridden by a definition in FreeRTOSConfig.h. */
 #define recmuMAX_COUNT                                 ( 10 )\r
 \r
 /* Misc. */\r
-#define recmuSHORT_DELAY                               ( 20 / portTICK_RATE_MS )\r
-#define recmuNO_DELAY                                  ( ( portTickType ) 0 )\r
-#define recmuFIVE_TICK_DELAY                   ( ( portTickType ) 5 )\r
+#define recmuSHORT_DELAY                               ( 20 / portTICK_PERIOD_MS )\r
+#define recmuNO_DELAY                                  ( ( TickType_t ) 0 )\r
+#define recmuEIGHT_TICK_DELAY                  ( ( TickType_t ) 8 )\r
 \r
 /* The three tasks as described at the top of this file. */\r
 static void prvRecursiveMutexControllingTask( void *pvParameters );\r
@@ -129,15 +129,15 @@ static void prvRecursiveMutexBlockingTask( void *pvParameters );
 static void prvRecursiveMutexPollingTask( void *pvParameters );\r
 \r
 /* The mutex used by the demo. */\r
-static xSemaphoreHandle xMutex;\r
+static SemaphoreHandle_t xMutex;\r
 \r
 /* Variables used to detect and latch errors. */\r
-static volatile portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;\r
-static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles = 0, uxPollingCycles = 0;\r
+static volatile BaseType_t xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;\r
+static volatile UBaseType_t uxControllingCycles = 0, uxBlockingCycles = 0, uxPollingCycles = 0;\r
 \r
 /* Handles of the two higher priority tasks, required so they can be resumed\r
 (unsuspended). */\r
-static xTaskHandle xControllingTaskHandle, xBlockingTaskHandle;\r
+static TaskHandle_t xControllingTaskHandle, xBlockingTaskHandle;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -153,7 +153,7 @@ void vStartRecursiveMutexTasks( void )
        is not being used.  The call to vQueueAddToRegistry() will be removed\r
        by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
        defined to be less than 1. */\r
-       vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Recursive_Mutex" );\r
+       vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" );\r
 \r
 \r
        if( xMutex != NULL )\r
@@ -167,7 +167,7 @@ void vStartRecursiveMutexTasks( void )
 \r
 static void prvRecursiveMutexControllingTask( void *pvParameters )\r
 {\r
-unsigned portBASE_TYPE ux;\r
+UBaseType_t ux;\r
 \r
        /* Just to remove compiler warning. */\r
        ( void ) pvParameters;\r
@@ -195,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, recmuFIVE_TICK_DELAY ) != pdPASS )\r
+                       if( xSemaphoreTakeRecursive( xMutex, recmuEIGHT_TICK_DELAY ) != pdPASS )\r
                        {\r
                                xErrorOccurred = pdTRUE;\r
                        }\r
@@ -388,10 +388,10 @@ static void prvRecursiveMutexPollingTask( void *pvParameters )
 /*-----------------------------------------------------------*/\r
 \r
 /* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreRecursiveMutexTasksStillRunning( void )\r
+BaseType_t xAreRecursiveMutexTasksStillRunning( void )\r
 {\r
-portBASE_TYPE xReturn;\r
-static unsigned portBASE_TYPE uxLastControllingCycles = 0, uxLastBlockingCycles = 0, uxLastPollingCycles = 0;\r
+BaseType_t xReturn;\r
+static UBaseType_t uxLastControllingCycles = 0, uxLastBlockingCycles = 0, uxLastPollingCycles = 0;\r
 \r
        /* Is the controlling task still cycling? */\r
        if( uxLastControllingCycles == uxControllingCycles )\r