Add volatile qualifier to loop counters used to detect stalled tasks.
This commit is contained in:
parent
bea704342a
commit
b19ede773a
@ -90,7 +90,7 @@ static void prvHighestPriorityPeekTask( void *pvParameters );
|
|||||||
|
|
||||||
/* Flag that will be latched to pdTRUE should any unexpected behaviour be
|
/* Flag that will be latched to pdTRUE should any unexpected behaviour be
|
||||||
detected in any of the tasks. */
|
detected in any of the tasks. */
|
||||||
static portBASE_TYPE xErrorDetected = pdFALSE;
|
static volatile portBASE_TYPE xErrorDetected = pdFALSE;
|
||||||
|
|
||||||
/* Counter that is incremented on each cycle of a test. This is used to
|
/* Counter that is incremented on each cycle of a test. This is used to
|
||||||
detect a stalled task - a test that is no longer running. */
|
detect a stalled task - a test that is no longer running. */
|
||||||
|
@ -82,8 +82,8 @@ to vTaskSuspend/Resume(). */
|
|||||||
static xTaskHandle xSecondary;
|
static xTaskHandle xSecondary;
|
||||||
|
|
||||||
/* Used to ensure that tasks are still executing without error. */
|
/* Used to ensure that tasks are still executing without error. */
|
||||||
static portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;
|
static volatile portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;
|
||||||
static portBASE_TYPE xErrorOccurred = pdFALSE;
|
static volatile portBASE_TYPE xErrorOccurred = pdFALSE;
|
||||||
|
|
||||||
/* Provides a simple mechanism for the primary task to know when the
|
/* Provides a simple mechanism for the primary task to know when the
|
||||||
secondary task has executed. */
|
secondary task has executed. */
|
||||||
|
@ -79,7 +79,7 @@ count value set to the maximum, and one with the count value set to zero. */
|
|||||||
|
|
||||||
/* Flag that will be latched to pdTRUE should any unexpected behaviour be
|
/* Flag that will be latched to pdTRUE should any unexpected behaviour be
|
||||||
detected in any of the tasks. */
|
detected in any of the tasks. */
|
||||||
static portBASE_TYPE xErrorDetected = pdFALSE;
|
static volatile portBASE_TYPE xErrorDetected = pdFALSE;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ typedef struct COUNT_SEM_STRUCT
|
|||||||
} xCountSemStruct;
|
} xCountSemStruct;
|
||||||
|
|
||||||
/* Two structures are defined, one is passed to each test task. */
|
/* Two structures are defined, one is passed to each test task. */
|
||||||
static xCountSemStruct xParameters[ countNUM_TEST_TASKS ];
|
static volatile xCountSemStruct xParameters[ countNUM_TEST_TASKS ];
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -148,9 +148,9 @@ static unsigned portLONG ulCounter;
|
|||||||
Each complete iteration of the controller task increments this variable
|
Each complete iteration of the controller task increments this variable
|
||||||
provided no errors have been found. The variable maintaining the same value
|
provided no errors have been found. The variable maintaining the same value
|
||||||
is therefore indication of an error. */
|
is therefore indication of an error. */
|
||||||
static unsigned portSHORT usCheckVariable = ( unsigned portSHORT ) 0;
|
static volatile unsigned portSHORT usCheckVariable = ( unsigned portSHORT ) 0;
|
||||||
static portBASE_TYPE xSuspendedQueueSendError = pdFALSE;
|
static volatile portBASE_TYPE xSuspendedQueueSendError = pdFALSE;
|
||||||
static portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
|
static volatile portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
|
||||||
|
|
||||||
/* Queue used by the second test. */
|
/* Queue used by the second test. */
|
||||||
xQueueHandle xSuspendedTestQueue;
|
xQueueHandle xSuspendedTestQueue;
|
||||||
|
@ -113,8 +113,8 @@ static void prvRecursiveMutexPollingTask( void *pvParameters );
|
|||||||
static xSemaphoreHandle xMutex;
|
static xSemaphoreHandle xMutex;
|
||||||
|
|
||||||
/* Variables used to detect and latch errors. */
|
/* Variables used to detect and latch errors. */
|
||||||
static portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;
|
static volatile portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;
|
||||||
static unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles, uxPollingCycles = 0;
|
static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles, uxPollingCycles = 0;
|
||||||
|
|
||||||
/* Handles of the two higher priority tasks, required so they can be resumed
|
/* Handles of the two higher priority tasks, required so they can be resumed
|
||||||
(unsuspended). */
|
(unsuspended). */
|
||||||
|
Reference in New Issue
Block a user