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

@ -78,7 +78,7 @@
#define partstMAX_OUTPUT_LED ( 4 )
#define partstFIRST_LED GPIO_Pin_6
static unsigned portSHORT usOutputValue = 0;
static unsigned short usOutputValue = 0;
/*-----------------------------------------------------------*/
@ -96,7 +96,7 @@ GPIO_InitTypeDef GPIO_InitStructure;
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned portSHORT usBit;
unsigned short usBit;
vTaskSuspendAll();
{
@ -106,7 +106,7 @@ unsigned portSHORT usBit;
if( xValue == pdFALSE )
{
usBit ^= ( unsigned portSHORT ) 0xffff;
usBit ^= ( unsigned short ) 0xffff;
usOutputValue &= usBit;
}
else
@ -123,7 +123,7 @@ unsigned portSHORT usBit;
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned portSHORT usBit;
unsigned short usBit;
vTaskSuspendAll();
{

View file

@ -150,7 +150,7 @@ time. */
#define mainCHECK_DELAY ( ( portTickType ) 5000 / portTICK_RATE_MS )
/* The number of nano seconds between each processor clock. */
#define mainNS_PER_CLOCK ( ( unsigned portLONG ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )
#define mainNS_PER_CLOCK ( ( unsigned long ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )
/* Baud rate used by the comtest tasks. */
#define mainCOM_TEST_BAUD_RATE ( 115200 )
@ -257,7 +257,7 @@ xLCDMessage xMessage;
/* Initialise the LCD and display a startup message. */
prvConfigureLCD();
LCD_DrawMonoPict( ( unsigned portLONG * ) pcBitmap );
LCD_DrawMonoPict( ( unsigned long * ) pcBitmap );
for( ;; )
{
@ -265,7 +265,7 @@ xLCDMessage xMessage;
while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );
/* Display the message. Print each message to a different position. */
printf( ( portCHAR const * ) xMessage.pcMessage );
printf( ( char const * ) xMessage.pcMessage );
}
}
/*-----------------------------------------------------------*/
@ -274,8 +274,8 @@ static void vCheckTask( void *pvParameters )
{
portTickType xLastExecutionTime;
xLCDMessage xMessage;
static signed portCHAR cPassMessage[ mainMAX_MSG_LEN ];
extern unsigned portSHORT usMaxJitter;
static signed char cPassMessage[ mainMAX_MSG_LEN ];
extern unsigned short usMaxJitter;
xLastExecutionTime = xTaskGetTickCount();
xMessage.pcMessage = cPassMessage;
@ -317,7 +317,7 @@ extern unsigned portSHORT usMaxJitter;
}
else
{
sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK );
sprintf( ( char * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned long ) usMaxJitter ) * mainNS_PER_CLOCK );
}
/* Send the message to the LCD gatekeeper for display. */
@ -340,7 +340,7 @@ static void prvSetupHardware( void )
}
/* 2 wait states required on the flash. */
*( ( unsigned portLONG * ) 0x40022000 ) = 0x02;
*( ( unsigned long * ) 0x40022000 ) = 0x02;
/* HCLK = SYSCLK */
RCC_HCLKConfig( RCC_SYSCLK_Div1 );
@ -418,8 +418,8 @@ GPIO_InitTypeDef GPIO_InitStructure;
int fputc( int ch, FILE *f )
{
static unsigned portSHORT usColumn = 0, usRefColumn = mainCOLUMN_START;
static unsigned portCHAR ucLine = 0;
static unsigned short usColumn = 0, usRefColumn = mainCOLUMN_START;
static unsigned char ucLine = 0;
if( ( usColumn == 0 ) && ( ucLine == 0 ) )
{
@ -463,7 +463,7 @@ static unsigned portCHAR ucLine = 0;
#ifdef DEBUG
/* Keep the linker happy. */
void assert_failed( unsigned portCHAR* pcFile, unsigned portLONG ulLine )
void assert_failed( unsigned char* pcFile, unsigned long ulLine )
{
for( ;; )
{

View file

@ -100,7 +100,7 @@ void vUARTInterruptHandler( void );
/*
* See the serial2.h header file.
*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
xComPortHandle xReturn;
USART_InitTypeDef USART_InitStructure;
@ -108,8 +108,8 @@ NVIC_InitTypeDef NVIC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
/* Create the queues used to hold Rx/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 ) );
/* If the queue/semaphore was created correctly then setup the serial port
hardware. */
@ -163,7 +163,7 @@ GPIO_InitTypeDef GPIO_InitStructure;
}
/*-----------------------------------------------------------*/
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 port. */
( void ) pxPort;
@ -181,9 +181,9 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcR
}
/*-----------------------------------------------------------*/
void vSerialPutString( xComPortHandle pxPort, const signed portCHAR * const pcString, unsigned portSHORT usStringLength )
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength )
{
signed portCHAR *pxNext;
signed char *pxNext;
/* A couple of parameters that this port does not use. */
( void ) usStringLength;
@ -196,7 +196,7 @@ signed portCHAR *pxNext;
( void ) pxPort;
/* Send each character in the string, one at a time. */
pxNext = ( signed portCHAR * ) pcString;
pxNext = ( signed char * ) pcString;
while( *pxNext )
{
xSerialPutChar( pxPort, *pxNext, serNO_BLOCK );
@ -205,7 +205,7 @@ signed portCHAR *pxNext;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
{
signed portBASE_TYPE xReturn;
@ -232,7 +232,7 @@ void vSerialClose( xComPortHandle xPort )
void vUARTInterruptHandler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
portCHAR cChar;
char cChar;
if( USART_GetITStatus( USART1, USART_IT_TXE ) == SET )
{

View file

@ -75,7 +75,7 @@
/* The set frequency of the interrupt. Deviations from this are measured as
the jitter. */
#define timerINTERRUPT_FREQUENCY ( ( unsigned portSHORT ) 20000 )
#define timerINTERRUPT_FREQUENCY ( ( unsigned short ) 20000 )
/* The expected time between each of the timer interrupts - if the jitter was
zero. */
@ -102,7 +102,7 @@ void vSetupTimerTest( void );
void vTimer2IntHandler( void );
/* Stores the value of the maximum recorded jitter between interrupts. */
volatile unsigned portSHORT usMaxJitter = 0;
volatile unsigned short usMaxJitter = 0;
/*-----------------------------------------------------------*/
@ -124,7 +124,7 @@ NVIC_InitTypeDef NVIC_InitStructure;
/* Time base configuration for timer 2 - which generates the interrupts. */
ulFrequency = configCPU_CLOCK_HZ / timerINTERRUPT_FREQUENCY;
TIM_TimeBaseStructure.TIM_Period = ( unsigned portSHORT ) ( ulFrequency & 0xffffUL );
TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) ( ulFrequency & 0xffffUL );
TIM_TimeBaseStructure.TIM_Prescaler = 0x0;
TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
@ -134,7 +134,7 @@ NVIC_InitTypeDef NVIC_InitStructure;
/* Configuration for timer 3 which is used as a high resolution time
measurement. */
TIM_TimeBaseStructure.TIM_Period = ( unsigned portSHORT ) 0xffff;
TIM_TimeBaseStructure.TIM_Period = ( unsigned short ) 0xffff;
TIM_TimeBaseInit( TIM3, &TIM_TimeBaseStructure );
TIM_ARRPreloadConfig( TIM3, ENABLE );
@ -154,8 +154,8 @@ NVIC_InitTypeDef NVIC_InitStructure;
void vTimer2IntHandler( void )
{
static unsigned portSHORT usLastCount = 0, usSettleCount = 0, usMaxDifference = 0;
unsigned portSHORT usThisCount, usDifference;
static unsigned short usLastCount = 0, usSettleCount = 0, usMaxDifference = 0;
unsigned short usThisCount, usDifference;
/* Capture the free running timer 3 value as we enter the interrupt. */
usThisCount = TIM3->CNT;