]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Full/semtest.c
Update the demo directory to use the version 8 type naming conventions.
[freertos] / FreeRTOS / Demo / Common / Full / semtest.c
index ffc176911ea7519fb5308392e1a09aa6d3120cbf..2084f8ddfe552db8fc21800e9a6b2ec17c02e846 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
-    FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.0.0:rc1 - 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
 \r
@@ -100,7 +101,7 @@ Changes from V1.2.0:
 Changes from V2.0.0\r
 \r
        + Delay periods are now specified using variables and constants of\r
-         portTickType rather than unsigned long.\r
+         TickType_t rather than unsigned long.\r
 \r
 Changes from V2.1.1\r
 \r
@@ -127,7 +128,7 @@ Changes from V2.1.1
 \r
 #define semtstNUM_TASKS                                ( 4 )\r
 \r
-#define semtstDELAY_FACTOR                     ( ( portTickType ) 10 )\r
+#define semtstDELAY_FACTOR                     ( ( TickType_t ) 10 )\r
 \r
 /* The task function as described at the top of the file. */\r
 static void prvSemaphoreTest( void *pvParameters );\r
@@ -135,9 +136,9 @@ static void prvSemaphoreTest( void *pvParameters );
 /* Structure used to pass parameters to each task. */\r
 typedef struct SEMAPHORE_PARAMETERS\r
 {\r
-       xSemaphoreHandle xSemaphore;\r
+       SemaphoreHandle_t xSemaphore;\r
        volatile unsigned long *pulSharedVariable;\r
-       portTickType xBlockTime;\r
+       TickType_t xBlockTime;\r
 } xSemaphoreParameters;\r
 \r
 /* Variables used to check that all the tasks are still running without errors. */\r
@@ -153,7 +154,7 @@ const char * const pcSemaphoreTaskStart = "Guarded shared variable task started.
 void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority )\r
 {\r
 xSemaphoreParameters *pxFirstSemaphoreParameters, *pxSecondSemaphoreParameters;\r
-const portTickType xBlockTime = ( portTickType ) 100;\r
+const TickType_t xBlockTime = ( TickType_t ) 100;\r
 \r
        /* Create the structure used to pass parameters to the first two tasks. */\r
        pxFirstSemaphoreParameters = ( xSemaphoreParameters * ) pvPortMalloc( sizeof( xSemaphoreParameters ) );\r
@@ -172,11 +173,11 @@ const portTickType xBlockTime = ( portTickType ) 100;
                        *( pxFirstSemaphoreParameters->pulSharedVariable ) = semtstNON_BLOCKING_EXPECTED_VALUE;\r
 \r
                        /* The first two tasks do not block on semaphore calls. */\r
-                       pxFirstSemaphoreParameters->xBlockTime = ( portTickType ) 0;\r
+                       pxFirstSemaphoreParameters->xBlockTime = ( TickType_t ) 0;\r
 \r
                        /* Spawn the first two tasks.  As they poll they operate at the idle priority. */\r
-                       xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
-                       xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
+                       xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );\r
+                       xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );\r
                }\r
        }\r
 \r
@@ -191,10 +192,10 @@ const portTickType xBlockTime = ( portTickType ) 100;
                {\r
                        pxSecondSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );\r
                        *( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;\r
-                       pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_RATE_MS;\r
+                       pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;\r
 \r
-                       xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
-                       xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
+                       xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );\r
+                       xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );\r
                }\r
        }\r
 }\r
@@ -224,7 +225,7 @@ short sError = pdFALSE, sCheckVariableToUse;
 \r
        /* If we are blocking we use a much higher count to ensure loads of context\r
        switches occur during the count. */\r
-       if( pxParameters->xBlockTime > ( portTickType ) 0 )\r
+       if( pxParameters->xBlockTime > ( TickType_t ) 0 )\r
        {\r
                ulExpectedValue = semtstBLOCKING_EXPECTED_VALUE;\r
        }\r
@@ -288,7 +289,7 @@ short sError = pdFALSE, sCheckVariableToUse;
                }\r
                else\r
                {\r
-                       if( pxParameters->xBlockTime == ( portTickType ) 0 )\r
+                       if( pxParameters->xBlockTime == ( TickType_t ) 0 )\r
                        {\r
                                /* We have not got the semaphore yet, so no point using the\r
                                processor.  We are not blocking when attempting to obtain the\r