FreeRTOS_lpc17xx_uart.c - incorrect ioctlSET_SPEED behavior
Market leading real time kernel for 40+ microcontroller architectures
Brought to you by:
gaurav-aws,
rtel
On LPC17xx:
ioctlSET_SPEED call resets "FIFO settings" and "Enable Tx flag", which are tuned by FreeRTOS_open().
"""
//code sample:
// ...
xPS_OpenedPort = FreeRTOS_open( (const I8*) SENSOR_UART, NULL );
if( xPS_OpenedPort != NULL )
{
FreeRTOS_ioctl( xPS_OpenedPort, ioctlSET_SPEED, ( void * ) UARTBaudRate );
// ...
"""
As workaround i've modified ioctlSET_SPEED in FreeRTOS_lpc17xx_uart.c (added code marked by "///+++", "///---"):
"""
case ioctlSET_SPEED :
/* Set up the default UART configuration. */ xUARTConfig.Baud_rate = ulValue; xUARTConfig.Databits = UART_DATABIT_8; xUARTConfig.Parity = UART_PARITY_NONE; xUARTConfig.Stopbits = UART_STOPBIT_1; UART_Init( pxUART, &xUARTConfig ); ///+++ /* Enable the FIFO. */ xUARTFIFOConfig.FIFO_ResetRxBuf = ENABLE; xUARTFIFOConfig.FIFO_ResetTxBuf = ENABLE; xUARTFIFOConfig.FIFO_DMAMode = DISABLE; xUARTFIFOConfig.FIFO_Level = UART_FIFO_TRGLEV2; UART_FIFOConfig( pxUART, &xUARTFIFOConfig ); /* Enable Tx. */ UART_TxCmd( pxUART, ENABLE ); ///--- break;
"""
"Featured FreeRTOS+IO and FreeRTOS+CLI Demo" - LPC1769_FreeRTOS_Plus_Featured_Demo_002.zip
Being replaced by the Common IO interface.