]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Demo/Common/FreeRTOS_Plus_CLI_Demos/UARTCommandConsole.c
Update version number ready for V8.2.1 release.
[freertos] / FreeRTOS-Plus / Demo / Common / FreeRTOS_Plus_CLI_Demos / UARTCommandConsole.c
index c3dc1e32adc357b71c1090c4d3bedf76daa133d5..be1fcb861e508de3c5f9e25498e5c69a45eb41ef 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
     the terms of the GNU General Public License (version 2) as published by the\r
     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \r
-       ***************************************************************************\r
+    ***************************************************************************\r
     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
     >>!   obliged to provide the source code for proprietary components     !<<\r
     >>!   outside of the FreeRTOS kernel.                                   !<<\r
-       ***************************************************************************\r
+    ***************************************************************************\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
     ***************************************************************************\r
 \r
     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-       the FAQ page "My application does not run, what could be wrong?".  Have you\r
-       defined configASSERT()?\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
 \r
-       http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-       embedded software for free we request you assist our global community by\r
-       participating in the support forum.\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
 \r
-       http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-       be as productive as possible as early as possible.  Now you can receive\r
-       FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-       Ltd, and the world's leading authority on the world's leading RTOS.\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
 /* 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