]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/countsem.c
Change how volatile is used in some of the standard demos to remove compiler warnings...
[freertos] / FreeRTOS / Demo / Common / Minimal / countsem.c
index 575eded65ed4c1975d089dcae940c2eebdea7801..503d7b0f52b08a3b3154ec1ef0aa6ddda3154349 100644 (file)
@@ -115,13 +115,13 @@ static void prvCountingSemaphoreTask( void *pvParameters );
  * Utility function to increment the semaphore count value up from zero to\r
  * countMAX_COUNT_VALUE.\r
  */\r
-static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter );\r
+static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, volatile UBaseType_t *puxLoopCounter );\r
 \r
 /*\r
  * Utility function to decrement the semaphore count value up from\r
  * countMAX_COUNT_VALUE to zero.\r
  */\r
-static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter );\r
+static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, volatile UBaseType_t *puxLoopCounter );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -138,11 +138,11 @@ typedef struct COUNT_SEM_STRUCT
 \r
        /* Incremented on each cycle of the demo task.  Used to detect a stalled\r
        task. */\r
-       UBaseType_t uxLoopCounter;\r
+       volatile UBaseType_t uxLoopCounter;\r
 } xCountSemStruct;\r
 \r
 /* Two structures are defined, one is passed to each test task. */\r
-static volatile xCountSemStruct xParameters[ countNUM_TEST_TASKS ];\r
+static xCountSemStruct xParameters[ countNUM_TEST_TASKS ];\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -178,7 +178,7 @@ void vStartCountingSemaphoreTasks( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter )\r
+static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, volatile UBaseType_t *puxLoopCounter )\r
 {\r
 UBaseType_t ux;\r
 \r
@@ -217,7 +217,7 @@ UBaseType_t ux;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter )\r
+static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, volatile UBaseType_t *puxLoopCounter )\r
 {\r
 UBaseType_t ux;\r
 \r