/*\r
- * FreeRTOS+CLI V1.0.3 (C) 2014 Real Time Engineers ltd. All rights reserved.\r
+ * FreeRTOS+CLI V1.0.4\r
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
*\r
- * This file is part of the FreeRTOS+CLI distribution. The FreeRTOS+CLI license\r
- * terms are different to the FreeRTOS license terms.\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
*\r
- * FreeRTOS+CLI uses a dual license model that allows the software to be used\r
- * under a standard GPL open source license, or a commercial license. The\r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
- * itself is distributed) requires that all software statically linked with\r
- * FreeRTOS+CLI is also distributed under the same GPL V2 license terms.\r
- * Details of both license options follow:\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
*\r
- * - Open source licensing -\r
- * FreeRTOS+CLI is a free download and may be used, modified, evaluated and\r
- * distributed without charge provided the user adheres to version two of the\r
- * GNU General Public License (GPL) and does not remove the copyright notice or\r
- * this text. The GPL V2 text is available on the gnu.org web site, and on the\r
- * following URL: http://www.FreeRTOS.org/gpl-2.0.txt.\r
- *\r
- * - Commercial licensing -\r
- * Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a low cost commercial\r
- * license before incorporating FreeRTOS+CLI into proprietary software for\r
- * distribution in any form. Commercial licenses can be purchased from\r
- * http://shop.freertos.org/cli and do not require any source files to be\r
- * changed.\r
- *\r
- * FreeRTOS+CLI is distributed in the hope that it will be useful. You cannot\r
- * use FreeRTOS+CLI unless you agree that you use the software 'as is'.\r
- * FreeRTOS+CLI is provided WITHOUT ANY WARRANTY; without even the implied\r
- * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
- * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
- * implied, expressed, or statutory.\r
- *\r
- * 1 tab == 4 spaces!\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
*\r
* http://www.FreeRTOS.org\r
- * http://www.FreeRTOS.org/FreeRTOS-Plus\r
+ * http://aws.amazon.com/freertos\r
*\r
+ * 1 tab == 4 spaces!\r
*/\r
\r
/* Standard includes. */\r
/* Utils includes. */\r
#include "FreeRTOS_CLI.h"\r
\r
+/* If the application writer needs to place the buffer used by the CLI at a\r
+fixed address then set configAPPLICATION_PROVIDES_cOutputBuffer to 1 in\r
+FreeRTOSConfig.h, then declare an array with the following name and size in \r
+one of the application files:\r
+ char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+*/\r
+#ifndef configAPPLICATION_PROVIDES_cOutputBuffer\r
+ #define configAPPLICATION_PROVIDES_cOutputBuffer 0\r
+#endif\r
+\r
typedef struct xCOMMAND_INPUT_LIST\r
{\r
const CLI_Command_Definition_t *pxCommandLineDefinition;\r
to save RAM. Note, however, that the command console itself is not re-entrant,\r
so only one command interpreter interface can be used at any one time. For that\r
reason, no attempt at providing mutual exclusion to the cOutputBuffer array is\r
-attempted. */\r
-static char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+attempted.\r
+\r
+configAPPLICATION_PROVIDES_cOutputBuffer is provided to allow the application\r
+writer to provide their own cOutputBuffer declaration in cases where the\r
+buffer needs to be placed at a fixed address (rather than by the linker). */\r
+#if( configAPPLICATION_PROVIDES_cOutputBuffer == 0 )\r
+ static char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+#else\r
+ extern char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+#endif\r
+\r
\r
/*-----------------------------------------------------------*/\r
\r