X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FCORTEX_STM32F103_IAR%2Fserial%2Fserial.c;h=ac6e8aca64c81df53ba53630fabb61ad6d5bb608;hb=19b29b9ac426c6f5c64009809b1cde1777abb285;hp=59a8cd0da2c8172ba45c299fbe6f04e17f499b06;hpb=abf43e0ca4466819c7c77a7bb37d72aa9175e471;p=freertos diff --git a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c index 59a8cd0da..ac6e8aca6 100644 --- a/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c +++ b/FreeRTOS/Demo/CORTEX_STM32F103_IAR/serial/serial.c @@ -1,5 +1,5 @@ /* - FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. + FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. @@ -80,15 +80,15 @@ /*-----------------------------------------------------------*/ /* Misc defines. */ -#define serINVALID_QUEUE ( ( xQueueHandle ) 0 ) -#define serNO_BLOCK ( ( portTickType ) 0 ) -#define serTX_BLOCK_TIME ( 40 / portTICK_RATE_MS ) +#define serINVALID_QUEUE ( ( QueueHandle_t ) 0 ) +#define serNO_BLOCK ( ( TickType_t ) 0 ) +#define serTX_BLOCK_TIME ( 40 / portTICK_PERIOD_MS ) /*-----------------------------------------------------------*/ /* The queue used to hold received characters. */ -static xQueueHandle xRxedChars; -static xQueueHandle xCharsForTx; +static QueueHandle_t xRxedChars; +static QueueHandle_t xCharsForTx; /*-----------------------------------------------------------*/ @@ -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, TickType_t 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, TickType_t 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 ) {