|
|
|
@ -83,7 +83,7 @@ static void prvUARTCommandConsoleTask( void *pvParameters );
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
/* Const messages output by the command console. */
|
|
|
|
|
static const uint8_t * const pcWelcomeMessage = ( uint8_t * ) "FreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";
|
|
|
|
|
static const uint8_t * const pcWelcomeMessage = ( uint8_t * ) "\r\n\r\nFreeRTOS command server.\r\nType Help to view a list of registered commands.\r\n\r\n>";
|
|
|
|
|
static const uint8_t * const pcEndOfOutputMessage = ( uint8_t * ) "\r\n[Press ENTER to execute the previous command again]\r\n>";
|
|
|
|
|
static const uint8_t * const pcNewLine = ( uint8_t * ) "\r\n";
|
|
|
|
|
|
|
|
|
@ -115,9 +115,6 @@ mss_uart_instance_t * const pxUART = &g_mss_uart0;
|
|
|
|
|
interface will be used at any one time. */
|
|
|
|
|
pcOutputString = FreeRTOS_CLIGetOutputBuffer();
|
|
|
|
|
|
|
|
|
|
/* Initialise the UART. */
|
|
|
|
|
MSS_UART_init( pxUART, MSS_UART_115200_BAUD, MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT );
|
|
|
|
|
|
|
|
|
|
/* Send the welcome message. */
|
|
|
|
|
MSS_UART_polled_tx_string( pxUART, ( uint8_t * ) pcWelcomeMessage );
|
|
|
|
|
|
|
|
|
@ -127,10 +124,10 @@ mss_uart_instance_t * const pxUART = &g_mss_uart0;
|
|
|
|
|
cRxedChar = 0;
|
|
|
|
|
|
|
|
|
|
/* Only interested in reading one character at a time. */
|
|
|
|
|
MSS_UART_get_rx( pxUART, &cRxedChar, sizeof( cRxedChar ) );
|
|
|
|
|
|
|
|
|
|
if( MSS_UART_get_rx( pxUART, ( uint8_t * ) &cRxedChar, sizeof( cRxedChar ) ) > 0 )
|
|
|
|
|
{
|
|
|
|
|
/* Echo the character back. */
|
|
|
|
|
MSS_UART_polled_tx( pxUART, &cRxedChar, sizeof( cRxedChar ) );
|
|
|
|
|
MSS_UART_polled_tx( pxUART, ( uint8_t * ) &cRxedChar, sizeof( cRxedChar ) );
|
|
|
|
|
|
|
|
|
|
/* Was it the end of the line? */
|
|
|
|
|
if( cRxedChar == '\n' || cRxedChar == '\r' )
|
|
|
|
@ -203,6 +200,7 @@ mss_uart_instance_t * const pxUART = &g_mss_uart0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|