static void prvSendToQueueInSetFromISR( void )\r
{\r
static BaseType_t xQueueToWriteTo = 0;\r
+uint32_t ulTxValueSnapshot = ulISRTxValue;\r
\r
- if( xQueueSendFromISR( xQueues[ xQueueToWriteTo ], ( void * ) &ulISRTxValue, NULL ) == pdPASS )\r
+ if( xQueueSendFromISR( xQueues[ xQueueToWriteTo ], ( void * ) &ulTxValueSnapshot, NULL ) == pdPASS )\r
{\r
ulISRTxValue++;\r
\r
* 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
\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
}\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
}\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
\r
/* The shared counter variable. This is passed in as a parameter to the two\r
counter variables for demonstration purposes. */\r
-static volatile uint32_t ulCounter;\r
+static uint32_t ulCounter;\r
\r
/* Variables used to check that the tasks are still operating without error.\r
Each complete iteration of the controller task increments this variable\r
*/\r
static portTASK_FUNCTION( vLimitedIncrementTask, pvParameters )\r
{\r
-uint32_t *pulCounter;\r
+volatile uint32_t *pulCounter;\r
\r
/* Take a pointer to the shared variable from the parameters passed into\r
the task. */\r
- pulCounter = ( uint32_t * ) pvParameters;\r
+ pulCounter = ( volatile uint32_t * ) pvParameters;\r
\r
/* This will run before the control task, so the first thing it does is\r
suspend - the control task will resume it when ready. */\r
\r
/* Take a pointer to the shared variable from the parameters passed into\r
the task. */\r
- pulCounter = ( uint32_t * ) pvParameters;\r
+ pulCounter = ( volatile uint32_t * ) pvParameters;\r
\r
/* Query our priority so we can raise it when exclusive access to the\r
shared variable is required. */\r
\r
/* These variables are used to check that all the tasks are still running. If a\r
task gets a calculation wrong it will stop setting its check variable. */\r
-static volatile uint16_t usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
+static uint16_t usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
+ pusTaskCheckVariable = ( volatile uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for(;;)\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
+ pusTaskCheckVariable = ( volatile uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for( ;; )\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
+ pusTaskCheckVariable = ( volatile uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
+ pusTaskCheckVariable = ( volatile uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
that the task is still executing. The check task sets the variable back to\r
false, flagging an error if the variable is still false the next time it\r
is called. */\r
-static volatile BaseType_t xTaskCheck[ intgNUMBER_OF_TASKS ] = { ( BaseType_t ) pdFALSE };\r
+static BaseType_t xTaskCheck[ intgNUMBER_OF_TASKS ] = { ( BaseType_t ) pdFALSE };\r
\r
/*-----------------------------------------------------------*/\r
\r