]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/UARTCommandConsole.c
Add the beginnings of a Microblaze project for the KC705.
[freertos] / FreeRTOS-Plus / Demo / Common / FreeRTOS_Plus_CLI_Demos / UARTCommandConsole.c
index c3dc1e32adc357b71c1090c4d3bedf76daa133d5..29368c00d434bd7856683b2d1616eced2fe8d995 100644 (file)
 /* Dimensions the buffer into which input characters are placed. */\r
 #define cmdMAX_INPUT_SIZE              50\r
 \r
+/* Dimentions a buffer to be used by the UART driver, if the UART driver uses a\r
+buffer at all. */\r
 #define cmdQUEUE_LENGTH                        25\r
 \r
 /* DEL acts as a backspace. */\r
 #define cmdASCII_DEL           ( 0x7F )\r
 \r
-#define cmdMAX_MUTEX_WAIT              ( ( ( TickType_t ) 300 ) / ( portTICK_PERIOD_MS ) )\r
+/* The maximum time to wait for the mutex that guards the UART to become\r
+available. */\r
+#define cmdMAX_MUTEX_WAIT              pdMS_TO_TICKS( 300 )\r
 \r
 #ifndef configCLI_BAUD_RATE\r
        #define configCLI_BAUD_RATE     115200\r
@@ -115,7 +119,11 @@ static const char * const pcWelcomeMessage = "FreeRTOS command server.\r\nType H
 static const char * const pcEndOfOutputMessage = "\r\n[Press ENTER to execute the previous command again]\r\n>";\r
 static const char * const pcNewLine = "\r\n";\r
 \r
-SemaphoreHandle_t xTxMutex = NULL;\r
+/* Used to guard access to the UART in case messages are sent to the UART from\r
+more than one task. */\r
+static SemaphoreHandle_t xTxMutex = NULL;\r
+\r
+/* The handle to the UART port, which is not used by all ports. */\r
 static xComPortHandle xPort = 0;\r
 \r
 /*-----------------------------------------------------------*/\r