mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Replace use of legacy portTYPE macros from old demos and standard demo files.
This commit is contained in:
parent
3e20aa7d60
commit
b54158d1dc
123 changed files with 736 additions and 736 deletions
|
@ -108,7 +108,7 @@ typedef struct BLOCKING_QUEUE_PARAMETERS
|
|||
{
|
||||
xQueueHandle xQueue; /*< The queue to be used by the task. */
|
||||
portTickType xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
volatile portSHORT *psCheckVariable; /*< Incremented on each successful cycle to check the task is still running. */
|
||||
volatile short *psCheckVariable; /*< Incremented on each successful cycle to check the task is still running. */
|
||||
} xBlockingQueueParameters;
|
||||
|
||||
/* Task function that creates an incrementing number and posts it on a queue. */
|
||||
|
@ -121,11 +121,11 @@ static portTASK_FUNCTION_PROTO( vBlockingQueueConsumer, pvParameters );
|
|||
/* Variables which are incremented each time an item is removed from a queue, and
|
||||
found to be the expected value.
|
||||
These are used to check that the tasks are still running. */
|
||||
static volatile portSHORT sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
|
||||
static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };
|
||||
|
||||
/* Variable which are incremented each time an item is posted on a queue. These
|
||||
are used to check that the tasks are still running. */
|
||||
static volatile portSHORT sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
|
||||
static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -145,7 +145,7 @@ const portTickType xDontBlock = ( portTickType ) 0;
|
|||
|
||||
/* Create the queue used by the first two tasks to pass the incrementing number.
|
||||
Pass a pointer to the queue in the parameter structure. */
|
||||
pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||
pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
|
||||
/* The consumer is created first so gets a block time as described above. */
|
||||
pxQueueParameters1->xBlockTime = xBlockTime;
|
||||
|
@ -180,7 +180,7 @@ const portTickType xDontBlock = ( portTickType ) 0;
|
|||
the same mechanism but reverses the task priorities. */
|
||||
|
||||
pxQueueParameters3 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );
|
||||
pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||
pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
pxQueueParameters3->xBlockTime = xDontBlock;
|
||||
pxQueueParameters3->psCheckVariable = &( sBlockingProducerCount[ 1 ] );
|
||||
|
||||
|
@ -197,7 +197,7 @@ const portTickType xDontBlock = ( portTickType ) 0;
|
|||
/* Create the last two tasks as described above. The mechanism is again just
|
||||
the same. This time both parameter structures are given a block time. */
|
||||
pxQueueParameters5 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );
|
||||
pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||
pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
pxQueueParameters5->xBlockTime = xBlockTime;
|
||||
pxQueueParameters5->psCheckVariable = &( sBlockingProducerCount[ 2 ] );
|
||||
|
||||
|
@ -213,14 +213,14 @@ const portTickType xDontBlock = ( portTickType ) 0;
|
|||
|
||||
static portTASK_FUNCTION( vBlockingQueueProducer, pvParameters )
|
||||
{
|
||||
unsigned portSHORT usValue = 0;
|
||||
unsigned short usValue = 0;
|
||||
xBlockingQueueParameters *pxQueueParameters;
|
||||
portSHORT sErrorEverOccurred = pdFALSE;
|
||||
short sErrorEverOccurred = pdFALSE;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt blocking queue producer task started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt blocking queue producer task started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -253,14 +253,14 @@ portSHORT sErrorEverOccurred = pdFALSE;
|
|||
|
||||
static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )
|
||||
{
|
||||
unsigned portSHORT usData, usExpectedValue = 0;
|
||||
unsigned short usData, usExpectedValue = 0;
|
||||
xBlockingQueueParameters *pxQueueParameters;
|
||||
portSHORT sErrorEverOccurred = pdFALSE;
|
||||
short sErrorEverOccurred = pdFALSE;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -300,8 +300,8 @@ portSHORT sErrorEverOccurred = pdFALSE;
|
|||
/* This is called to check that all the created tasks are still running. */
|
||||
portBASE_TYPE xAreAltBlockingQueuesStillRunning( void )
|
||||
{
|
||||
static portSHORT sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
|
||||
static portSHORT sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
|
||||
static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };
|
||||
static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };
|
||||
portBASE_TYPE xReturn = pdPASS, xTasks;
|
||||
|
||||
/* Not too worried about mutual exclusion on these variables as they are 16
|
||||
|
|
|
@ -140,9 +140,9 @@ portTickType xTimeWhenBlocking;
|
|||
portTickType xTimeToBlock, xBlockedTime;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt primary block time test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt primary block time test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -419,9 +419,9 @@ portTickType xTimeWhenBlocking, xBlockedTime;
|
|||
portBASE_TYPE xData;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt secondary block time test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt secondary block time test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned portLONG.
|
||||
portTickType rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -126,7 +126,7 @@ void vStartAltPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
|
|||
static xQueueHandle xPolledQueue;
|
||||
|
||||
/* Create the queue used by the producer and consumer. */
|
||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
|
||||
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
|
@ -145,13 +145,13 @@ static xQueueHandle xPolledQueue;
|
|||
|
||||
static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )
|
||||
{
|
||||
unsigned portSHORT usValue = ( unsigned portSHORT ) 0;
|
||||
unsigned short usValue = ( unsigned short ) 0;
|
||||
signed portBASE_TYPE xError = pdFALSE, xLoop;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt polling queue producer task started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt polling queue producer task started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -193,13 +193,13 @@ signed portBASE_TYPE xError = pdFALSE, xLoop;
|
|||
|
||||
static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )
|
||||
{
|
||||
unsigned portSHORT usData, usExpectedValue = ( unsigned portSHORT ) 0;
|
||||
unsigned short usData, usExpectedValue = ( unsigned short ) 0;
|
||||
signed portBASE_TYPE xError = pdFALSE;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
|
|
@ -127,11 +127,11 @@ static portBASE_TYPE xErrorDetected = pdFALSE;
|
|||
|
||||
/* Counters that are incremented on each cycle of a test. This is used to
|
||||
detect a stalled task - a test that is no longer running. */
|
||||
static volatile unsigned portLONG ulLoopCounter = 0;
|
||||
static volatile unsigned portLONG ulLoopCounter2 = 0;
|
||||
static volatile unsigned long ulLoopCounter = 0;
|
||||
static volatile unsigned long ulLoopCounter2 = 0;
|
||||
|
||||
/* The variable that is guarded by the mutex in the mutex demo tasks. */
|
||||
static volatile unsigned portLONG ulGuardedVariable = 0;
|
||||
static volatile unsigned long ulGuardedVariable = 0;
|
||||
|
||||
/* Handles used in the mutext test to suspend and resume the high and medium
|
||||
priority mutex test tasks. */
|
||||
|
@ -146,7 +146,7 @@ xSemaphoreHandle xMutex;
|
|||
|
||||
/* Create the queue that we are going to use for the
|
||||
prvSendFrontAndBackTest demo. */
|
||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned long ) );
|
||||
|
||||
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
|
@ -183,13 +183,13 @@ xSemaphoreHandle xMutex;
|
|||
|
||||
static void prvSendFrontAndBackTest( void *pvParameters )
|
||||
{
|
||||
unsigned portLONG ulData, ulData2;
|
||||
unsigned long ulData, ulData2;
|
||||
xQueueHandle xQueue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Alt queue SendToFront/SendToBack/Peek test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Alt queue SendToFront/SendToBack/Peek test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -414,9 +414,9 @@ static void prvLowPriorityMutexTask( void *pvParameters )
|
|||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Fast mutex with priority inheritance test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Fast mutex with priority inheritance test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -561,7 +561,7 @@ xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
|||
/* This is called to check that all the created tasks are still running. */
|
||||
portBASE_TYPE xAreAltGenericQueueTasksStillRunning( void )
|
||||
{
|
||||
static unsigned portLONG ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;
|
||||
static unsigned long ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;
|
||||
|
||||
/* If the demo task is still running then we expect the loopcounters to
|
||||
have incremented since this function was last called. */
|
||||
|
|
|
@ -150,7 +150,7 @@ have been found. Used to detect an error or stall in the test cycling. */
|
|||
static volatile unsigned long ulSetBitCycles = 0, ulWaitBitCycles = 0;
|
||||
|
||||
/* The event group used by all the tests. */
|
||||
static xEventGroupHandle xEventBits = NULL;
|
||||
static EventGroupHandle_t xEventBits = NULL;
|
||||
|
||||
/* Handles to the tasks that only take part in the synchronisation calls. */
|
||||
static xTaskHandle xSyncTask1 = NULL, xSyncTask2 = NULL;
|
||||
|
@ -179,11 +179,11 @@ xTaskHandle xWaitBitsTaskHandle;
|
|||
|
||||
static void prvSyncTask( void *pvParameters )
|
||||
{
|
||||
xEventBitsType uxSynchronisationBit, uxReturned;
|
||||
EventBits_t uxSynchronisationBit, uxReturned;
|
||||
|
||||
/* The bit to use to indicate this task is at the synchronisation point is
|
||||
passed in as the task parameter. */
|
||||
uxSynchronisationBit = ( xEventBitsType ) pvParameters;
|
||||
uxSynchronisationBit = ( EventBits_t ) pvParameters;
|
||||
|
||||
/* A few tests are performed before entering the main demo loop. */
|
||||
prvPreSyncSelectiveWakeTest();
|
||||
|
@ -218,7 +218,7 @@ xEventBitsType uxSynchronisationBit, uxReturned;
|
|||
|
||||
static void prvWaitBitsTask( void *pvParameters )
|
||||
{
|
||||
xEventBitsType uxReturned;
|
||||
EventBits_t uxReturned;
|
||||
portBASE_TYPE xError = pdFALSE;
|
||||
|
||||
/* Avoid compiler warnings. */
|
||||
|
@ -346,7 +346,7 @@ portBASE_TYPE xError = pdFALSE;
|
|||
|
||||
static void prvSetBitsTask( void *pvParameters )
|
||||
{
|
||||
xEventBitsType uxBits;
|
||||
EventBits_t uxBits;
|
||||
portBASE_TYPE xError;
|
||||
|
||||
/* The handle to the other task is passed in as the task parameter. */
|
||||
|
@ -669,7 +669,7 @@ xTaskHandle xWaitBitsTaskHandle = ( xTaskHandle ) pvParameters;
|
|||
|
||||
static void prvPreSyncSelectiveWakeTest( void )
|
||||
{
|
||||
xEventBitsType uxPendBits, uxReturned;
|
||||
EventBits_t uxPendBits, uxReturned;
|
||||
|
||||
if( xTaskGetCurrentTaskHandle() == xSyncTask1 )
|
||||
{
|
||||
|
@ -685,7 +685,7 @@ xEventBitsType uxPendBits, uxReturned;
|
|||
vTaskSuspend( NULL );
|
||||
uxReturned = xEventGroupWaitBits( xEventBits, uxPendBits, pdTRUE, pdFALSE, portMAX_DELAY );
|
||||
|
||||
if( uxReturned == ( xEventBitsType ) 0 )
|
||||
if( uxReturned == ( EventBits_t ) 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -696,7 +696,7 @@ xEventBitsType uxPendBits, uxReturned;
|
|||
static portBASE_TYPE prvTestSelectiveBits( void )
|
||||
{
|
||||
portBASE_TYPE xError = pdFALSE;
|
||||
xEventBitsType uxBit;
|
||||
EventBits_t uxBit;
|
||||
|
||||
/* Both tasks should start in the suspended state. */
|
||||
if( eTaskGetState( xSyncTask1 ) != eSuspended )
|
||||
|
|
|
@ -129,11 +129,11 @@ static volatile portBASE_TYPE xErrorDetected = pdFALSE;
|
|||
|
||||
/* Counters that are incremented on each cycle of a test. This is used to
|
||||
detect a stalled task - a test that is no longer running. */
|
||||
static volatile unsigned portLONG ulLoopCounter = 0;
|
||||
static volatile unsigned portLONG ulLoopCounter2 = 0;
|
||||
static volatile unsigned long ulLoopCounter = 0;
|
||||
static volatile unsigned long ulLoopCounter2 = 0;
|
||||
|
||||
/* The variable that is guarded by the mutex in the mutex demo tasks. */
|
||||
static volatile unsigned portLONG ulGuardedVariable = 0;
|
||||
static volatile unsigned long ulGuardedVariable = 0;
|
||||
|
||||
/* Handles used in the mutext test to suspend and resume the high and medium
|
||||
priority mutex test tasks. */
|
||||
|
@ -148,7 +148,7 @@ xSemaphoreHandle xMutex;
|
|||
|
||||
/* Create the queue that we are going to use for the
|
||||
prvSendFrontAndBackTest demo. */
|
||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned long ) );
|
||||
|
||||
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
|
@ -185,13 +185,13 @@ xSemaphoreHandle xMutex;
|
|||
|
||||
static void prvSendFrontAndBackTest( void *pvParameters )
|
||||
{
|
||||
unsigned portLONG ulData, ulData2;
|
||||
unsigned long ulData, ulData2;
|
||||
xQueueHandle xQueue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Queue SendToFront/SendToBack/Peek test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Queue SendToFront/SendToBack/Peek test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -416,9 +416,9 @@ static void prvLowPriorityMutexTask( void *pvParameters )
|
|||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Mutex with priority inheritance test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Mutex with priority inheritance test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -574,7 +574,7 @@ xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
|||
/* This is called to check that all the created tasks are still running. */
|
||||
portBASE_TYPE xAreGenericQueueTasksStillRunning( void )
|
||||
{
|
||||
static unsigned portLONG ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;
|
||||
static unsigned long ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;
|
||||
|
||||
/* If the demo task is still running then we expect the loopcounters to
|
||||
have incremented since this function was last called. */
|
||||
|
|
|
@ -202,8 +202,8 @@ xTaskHandle xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xH
|
|||
the array position of the value is set to a the identifier of the task or
|
||||
interrupt that accessed the queue. This way missing or duplicate values can be
|
||||
detected. */
|
||||
static unsigned portCHAR ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };
|
||||
static unsigned portCHAR ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };
|
||||
static unsigned char ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };
|
||||
static unsigned char ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };
|
||||
|
||||
/* The test tasks themselves. */
|
||||
static void prvLowerPriorityNormallyEmptyTask( void *pvParameters );
|
||||
|
|
|
@ -110,7 +110,7 @@ static volatile portBASE_TYPE xErrorDetected = pdFALSE;
|
|||
|
||||
/* 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. */
|
||||
static volatile unsigned portLONG ulLoopCounter = 0;
|
||||
static volatile unsigned long ulLoopCounter = 0;
|
||||
|
||||
/* Handles to the test tasks. */
|
||||
xTaskHandle xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;
|
||||
|
@ -121,7 +121,7 @@ void vStartQueuePeekTasks( void )
|
|||
xQueueHandle xQueue;
|
||||
|
||||
/* Create the queue that we are going to use for the test/demo. */
|
||||
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned long ) );
|
||||
|
||||
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
|
@ -144,13 +144,13 @@ xQueueHandle xQueue;
|
|||
static void prvHighestPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
unsigned portLONG ulValue;
|
||||
unsigned long ulValue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
{
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Queue peek test started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Queue peek test started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
@ -253,7 +253,7 @@ unsigned portLONG ulValue;
|
|||
static void prvHighPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
unsigned portLONG ulValue;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ unsigned portLONG ulValue;
|
|||
static void prvMediumPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
unsigned portLONG ulValue;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
@ -349,7 +349,7 @@ unsigned portLONG ulValue;
|
|||
static void prvLowPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
unsigned portLONG ulValue;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
@ -455,7 +455,7 @@ unsigned portLONG ulValue;
|
|||
/* This is called to check that all the created tasks are still running. */
|
||||
portBASE_TYPE xAreQueuePeekTasksStillRunning( void )
|
||||
{
|
||||
static unsigned portLONG ulLastLoopCounter = 0;
|
||||
static unsigned long ulLastLoopCounter = 0;
|
||||
|
||||
/* If the demo task is still running then we expect the loopcounter to
|
||||
have incremented since this function was last called. */
|
||||
|
|
|
@ -252,9 +252,9 @@ static void prvCountingSemaphoreTask( void *pvParameters )
|
|||
xCountSemStruct *pxParameter;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend );
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
||||
const portCHAR * const pcTaskStartMsg = "Counting semaphore demo started.\r\n";
|
||||
const char * const pcTaskStartMsg = "Counting semaphore demo started.\r\n";
|
||||
|
||||
/* Queue a message for printing to say the task has started. */
|
||||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
|
|
@ -118,12 +118,12 @@ created. */
|
|||
/*
|
||||
* The 'fixed delay' co-routine as described at the top of the file.
|
||||
*/
|
||||
static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
|
||||
/*
|
||||
* The 'flash' co-routine as described at the top of the file.
|
||||
*/
|
||||
static void prvFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
|
||||
/* The queue used to pass data between the 'fixed delay' co-routines and the
|
||||
'flash' co-routine. */
|
||||
|
@ -163,7 +163,7 @@ unsigned portBASE_TYPE uxIndex;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
{
|
||||
/* Even though this is a co-routine the xResult variable does not need to be
|
||||
static as we do not need it to maintain its state between blocks. */
|
||||
|
@ -204,7 +204,7 @@ static const portTickType xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_R
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
{
|
||||
/* Even though this is a co-routine the variable do not need to be
|
||||
static as we do not need it to maintain their state between blocks. */
|
||||
|
|
|
@ -115,7 +115,7 @@ posted to the 'hook' co-routines. */
|
|||
/*
|
||||
* The co-routine function itself.
|
||||
*/
|
||||
static void prvHookCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
static void prvHookCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );
|
||||
|
||||
|
||||
/*
|
||||
|
@ -217,7 +217,7 @@ signed portBASE_TYPE xIndex, xCoRoutineWoken;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvHookCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
static void prvHookCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )
|
||||
{
|
||||
static unsigned portBASE_TYPE uxReceivedValue[ hookNUM_HOOK_CO_ROUTINES ];
|
||||
portBASE_TYPE xResult;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue