Replace use of legacy portTYPE macros from old demos and standard demo files.

This commit is contained in:
Richard Barry 2013-12-29 14:49:03 +00:00
parent 3e20aa7d60
commit b54158d1dc
123 changed files with 736 additions and 736 deletions

View file

@ -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