mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -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
|
@ -125,11 +125,11 @@ static void vFlopTest2( void *pvParameters );
|
|||
|
||||
/* Buffers into which the flop registers will be saved. There is a buffer for
|
||||
both tasks. */
|
||||
static volatile unsigned portLONG ulFlopRegisters[ flopNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];
|
||||
static volatile unsigned long ulFlopRegisters[ flopNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];
|
||||
|
||||
/* Variables that are incremented by the tasks to indicate that they are still
|
||||
running. */
|
||||
static volatile unsigned portLONG ulFlop1CycleCount = 0, ulFlop2CycleCount = 0;
|
||||
static volatile unsigned long ulFlop1CycleCount = 0, ulFlop2CycleCount = 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -219,7 +219,7 @@ portBASE_TYPE xAreFlopRegisterTestsStillRunning( void )
|
|||
{
|
||||
portBASE_TYPE xReturn = pdPASS;
|
||||
unsigned portBASE_TYPE x, y, z = flopSTART_VALUE;
|
||||
static unsigned portLONG ulLastFlop1CycleCount = 0, ulLastFlop2CycleCount = 0;
|
||||
static unsigned long ulLastFlop1CycleCount = 0, ulLastFlop2CycleCount = 0;
|
||||
|
||||
/* Called from the 'check' task.
|
||||
|
||||
|
|
|
@ -102,13 +102,13 @@ static portTASK_FUNCTION_PROTO( vCompetingMathTask4, pvParameters );
|
|||
|
||||
/* These variables are used to check that all the tasks are still running. If a
|
||||
task gets a calculation wrong it will stop incrementing its check variable. */
|
||||
static volatile unsigned portSHORT usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };
|
||||
static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };
|
||||
|
||||
/* Buffers into which the flop registers will be saved. There is a buffer for
|
||||
each task created within this file. Zeroing out this array is the normal and
|
||||
safe option as this will cause the task to start with all zeros in its flop
|
||||
context. */
|
||||
static unsigned portLONG ulFlopRegisters[ mathNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];
|
||||
static unsigned long ulFlopRegisters[ mathNUMBER_OF_TASKS ][ portNO_FLOP_REGISTERS_TO_SAVE ];
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -172,9 +172,9 @@ portBASE_TYPE x, y;
|
|||
static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )
|
||||
{
|
||||
volatile portFLOAT ff1, ff2, ff3, ff4;
|
||||
volatile unsigned portSHORT *pusTaskCheckVariable;
|
||||
volatile unsigned short *pusTaskCheckVariable;
|
||||
volatile portFLOAT fAnswer;
|
||||
portSHORT sError = pdFALSE;
|
||||
short sError = pdFALSE;
|
||||
|
||||
ff1 = 123.4567F;
|
||||
ff2 = 2345.6789F;
|
||||
|
@ -184,7 +184,7 @@ portSHORT sError = pdFALSE;
|
|||
|
||||
/* The variable this task increments to show it is still running is passed in
|
||||
as the parameter. */
|
||||
pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;
|
||||
pusTaskCheckVariable = ( unsigned short * ) pvParameters;
|
||||
|
||||
/* Keep performing a calculation and checking the result against a constant. */
|
||||
for(;;)
|
||||
|
@ -224,9 +224,9 @@ portSHORT sError = pdFALSE;
|
|||
static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )
|
||||
{
|
||||
volatile portFLOAT ff1, ff2, ff3, ff4;
|
||||
volatile unsigned portSHORT *pusTaskCheckVariable;
|
||||
volatile unsigned short *pusTaskCheckVariable;
|
||||
volatile portFLOAT fAnswer;
|
||||
portSHORT sError = pdFALSE;
|
||||
short sError = pdFALSE;
|
||||
|
||||
ff1 = -389.38F;
|
||||
ff2 = 32498.2F;
|
||||
|
@ -237,7 +237,7 @@ portSHORT sError = pdFALSE;
|
|||
|
||||
/* The variable this task increments to show it is still running is passed in
|
||||
as the parameter. */
|
||||
pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;
|
||||
pusTaskCheckVariable = ( unsigned short * ) pvParameters;
|
||||
|
||||
/* Keep performing a calculation and checking the result against a constant. */
|
||||
for( ;; )
|
||||
|
@ -277,14 +277,14 @@ portSHORT sError = pdFALSE;
|
|||
static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )
|
||||
{
|
||||
volatile portFLOAT *pfArray, fTotal1, fTotal2, fDifference;
|
||||
volatile unsigned portSHORT *pusTaskCheckVariable;
|
||||
volatile unsigned short *pusTaskCheckVariable;
|
||||
const size_t xArraySize = 10;
|
||||
size_t xPosition;
|
||||
portSHORT sError = pdFALSE;
|
||||
short sError = pdFALSE;
|
||||
|
||||
/* The variable this task increments to show it is still running is passed in
|
||||
as the parameter. */
|
||||
pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;
|
||||
pusTaskCheckVariable = ( unsigned short * ) pvParameters;
|
||||
|
||||
pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) );
|
||||
|
||||
|
@ -334,14 +334,14 @@ portSHORT sError = pdFALSE;
|
|||
static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )
|
||||
{
|
||||
volatile portFLOAT *pfArray, fTotal1, fTotal2, fDifference;
|
||||
volatile unsigned portSHORT *pusTaskCheckVariable;
|
||||
volatile unsigned short *pusTaskCheckVariable;
|
||||
const size_t xArraySize = 10;
|
||||
size_t xPosition;
|
||||
portSHORT sError = pdFALSE;
|
||||
short sError = pdFALSE;
|
||||
|
||||
/* The variable this task increments to show it is still running is passed in
|
||||
as the parameter. */
|
||||
pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;
|
||||
pusTaskCheckVariable = ( unsigned short * ) pvParameters;
|
||||
|
||||
pfArray = ( portFLOAT * ) pvPortMalloc( xArraySize * sizeof( portFLOAT ) );
|
||||
|
||||
|
@ -393,7 +393,7 @@ portBASE_TYPE xAreMathsTaskStillRunning( void )
|
|||
{
|
||||
/* Keep a history of the check variables so we know if they have been incremented
|
||||
since the last call. */
|
||||
static unsigned portSHORT usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };
|
||||
static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };
|
||||
portBASE_TYPE xReturn = pdTRUE, xTask;
|
||||
|
||||
/* Check the maths tasks are still running by ensuring their check variables
|
||||
|
|
|
@ -167,7 +167,7 @@ discover an unexpected value. */
|
|||
static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS;
|
||||
|
||||
/* Counters used to ensure the regtest tasks are still running. */
|
||||
static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
|
||||
static volatile unsigned long ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -232,7 +232,7 @@ int main( void )
|
|||
static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )
|
||||
{
|
||||
portBASE_TYPE lReturn = pdPASS;
|
||||
static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
|
||||
static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
|
||||
|
||||
/* The demo tasks maintain a count that increments every cycle of the task
|
||||
provided that the task has never encountered an error. This function
|
||||
|
@ -697,12 +697,12 @@ static void prvRegTestTask2( void *pvParameters )
|
|||
/* This hook function will get called if there is a suspected stack overflow.
|
||||
An overflow can cause the task name to be corrupted, in which case the task
|
||||
handle needs to be used to determine the offending task. */
|
||||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName );
|
||||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName )
|
||||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed char *pcTaskName );
|
||||
void vApplicationStackOverflowHook( xTaskHandle xTask, signed char *pcTaskName )
|
||||
{
|
||||
/* To prevent the optimiser removing the variables. */
|
||||
volatile xTaskHandle xTaskIn = xTask;
|
||||
volatile signed portCHAR *pcTaskNameIn = pcTaskName;
|
||||
volatile signed char *pcTaskNameIn = pcTaskName;
|
||||
|
||||
/* Remove compiler warnings. */
|
||||
( void ) xTaskIn;
|
||||
|
|
|
@ -100,7 +100,7 @@ static void vSerialISR( XUartLite *pxUART );
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
|
||||
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
|
||||
{
|
||||
/* NOTE: The baud rate used by this driver is determined by the hardware
|
||||
parameterization of the UART Lite peripheral, and the baud value passed to
|
||||
|
@ -108,8 +108,8 @@ xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned
|
|||
( void ) ulWantedBaud;
|
||||
|
||||
/* Create the queues used to hold Rx and Tx characters. */
|
||||
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
|
||||
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
|
||||
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );
|
||||
xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed char ) );
|
||||
|
||||
/* Only initialise the UART if the queues were created correctly. */
|
||||
if( ( xRxedChars != NULL ) && ( xCharsForTx != NULL ) )
|
||||
|
@ -133,7 +133,7 @@ xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
|
||||
{
|
||||
/* The port handle is not required as this driver only supports one UART. */
|
||||
( void ) pxPort;
|
||||
|
@ -151,7 +151,7 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcR
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
|
||||
{
|
||||
portBASE_TYPE xReturn = pdTRUE;
|
||||
|
||||
|
@ -202,9 +202,9 @@ void vSerialClose( xComPortHandle xPort )
|
|||
|
||||
static void vSerialISR( XUartLite *pxUART )
|
||||
{
|
||||
unsigned portLONG ulISRStatus;
|
||||
unsigned long ulISRStatus;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, lDidSomething;
|
||||
portCHAR cChar;
|
||||
char cChar;
|
||||
|
||||
/* Just to remove compiler warning. */
|
||||
( void ) pxUART;
|
||||
|
@ -220,7 +220,7 @@ portCHAR cChar;
|
|||
/* A character is available - place it in the queue of received
|
||||
characters. This might wake a task that was blocked waiting for
|
||||
data. */
|
||||
cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET );
|
||||
cChar = ( char ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET );
|
||||
xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken );
|
||||
lDidSomething = pdTRUE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue