/*\r
- FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+ FreeRTOS V8.0.1 - Copyright (C) 2014 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
- >>! NOTE: The modification to the GPL is included to allow you to distribute\r
- >>! a combined work that includes FreeRTOS without being obliged to provide\r
- >>! the source code for proprietary components outside of the FreeRTOS\r
- >>! kernel.\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
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
* See http://www.serialporttool.com/CommEcho.htm for a suitable echo server\r
* for Windows hosts.\r
*\r
- * The timer sends a string to the UART, toggles an LED, then resets itself by \r
- * changing its own period. The period is calculated as a pseudo random number \r
+ * The timer sends a string to the UART, toggles an LED, then resets itself by\r
+ * changing its own period. The period is calculated as a pseudo random number\r
* between comTX_MAX_BLOCK_TIME and comTX_MIN_BLOCK_TIME.\r
*\r
- * The task blocks on an Rx queue waiting for a character to become available. \r
- * Received characters are checked to ensure they match those transmitted by the \r
- * Tx timer. An error is latched if characters are missing, incorrect, or \r
+ * The task blocks on an Rx queue waiting for a character to become available.\r
+ * Received characters are checked to ensure they match those transmitted by the\r
+ * Tx timer. An error is latched if characters are missing, incorrect, or\r
* arrive too slowly.\r
*\r
* How characters are actually transmitted and received is port specific. Demos\r
* that include this test/demo file will provide example drivers. The Tx timer\r
- * executes in the context of the timer service (daemon) task, and must \r
+ * executes in the context of the timer service (daemon) task, and must\r
* therefore never attempt to block.\r
*\r
*/\r
/* The Tx timer transmits the sequence of characters at a pseudo random\r
interval that is capped between comTX_MAX_BLOCK_TIME and\r
comTX_MIN_BLOCK_TIME. */\r
-#define comTX_MAX_BLOCK_TIME ( ( portTickType ) 0x96 )\r
-#define comTX_MIN_BLOCK_TIME ( ( portTickType ) 0x32 )\r
-#define comOFFSET_TIME ( ( portTickType ) 3 )\r
+#define comTX_MAX_BLOCK_TIME ( ( TickType_t ) 0x96 )\r
+#define comTX_MIN_BLOCK_TIME ( ( TickType_t ) 0x32 )\r
+#define comOFFSET_TIME ( ( TickType_t ) 3 )\r
\r
/* States for the simple state machine implemented in the Rx task. */\r
#define comtstWAITING_START_OF_STRING 0\r
to comTX_MIN_BLOCK_TIME to ensure it is never longer than the shortest gap\r
between transmissions. It could be worked out more scientifically from the\r
baud rate being used. */\r
-#define comSHORT_DELAY ( comTX_MIN_BLOCK_TIME >> ( portTickType ) 2 )\r
+#define comSHORT_DELAY ( comTX_MIN_BLOCK_TIME >> ( TickType_t ) 2 )\r
\r
/* The string that is transmitted and received. */\r
#define comTRANSACTED_STRING "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"\r
\r
/* A block time of 0 simply means "don't block". */\r
-#define comtstDONT_BLOCK ( portTickType ) 0\r
+#define comtstDONT_BLOCK ( TickType_t ) 0\r
\r
/* Handle to the com port used by both tasks. */\r
static xComPortHandle xPort = NULL;\r
\r
/* The callback function allocated to the transmit timer, as described in the\r
comments at the top of this file. */\r
-static void prvComTxTimerCallback( xTimerHandle xTimer );\r
+static void prvComTxTimerCallback( TimerHandle_t xTimer );\r
\r
/* The receive task as described in the comments at the top of this file. */\r
static void vComRxTask( void *pvParameters );\r
\r
/* The timer used to periodically transmit the string. This is the timer that\r
has prvComTxTimerCallback allocated to it as its callback function. */\r
-static xTimerHandle xTxTimer = NULL;\r
+static TimerHandle_t xTxTimer = NULL;\r
\r
/* The string length is held at file scope so the Tx timer does not need to\r
calculate it each time it executes. */\r
\r
/* Create the Rx task and the Tx timer. The timer is started from the\r
Rx task. */\r
- xTaskCreate( vComRxTask, ( signed char * ) "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );\r
- xTxTimer = xTimerCreate( ( const signed char * ) "TxTimer", comTX_MIN_BLOCK_TIME, pdFALSE, NULL, prvComTxTimerCallback );\r
+ xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );\r
+ xTxTimer = xTimerCreate( "TxTimer", comTX_MIN_BLOCK_TIME, pdFALSE, NULL, prvComTxTimerCallback );\r
configASSERT( xTxTimer );\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvComTxTimerCallback( xTimerHandle xTimer )\r
+static void prvComTxTimerCallback( TimerHandle_t xTimer )\r
{\r
-portTickType xTimeToWait;\r
+TickType_t xTimeToWait;\r
\r
/* The parameter is not used in this case. */\r
( void ) xTimer;\r
sample driver provided with this demo. However - as this is a timer,\r
it executes in the context of the timer task and therefore must not\r
block. */\r
- vSerialPutString( xPort, ( const signed char * const ) comTRANSACTED_STRING, xStringLength );\r
+ vSerialPutString( xPort, comTRANSACTED_STRING, xStringLength );\r
\r
/* Toggle an LED to give a visible indication that another transmission\r
has been performed. */\r
static void vComRxTask( void *pvParameters )\r
{\r
portBASE_TYPE xState = comtstWAITING_START_OF_STRING, xErrorOccurred = pdFALSE;\r
-signed char *pcExpectedByte, cRxedChar;\r
+char *pcExpectedByte, cRxedChar;\r
const xComPortHandle xPort = NULL;\r
\r
/* The parameter is not used in this example. */\r
\r
/* The first expected Rx character is the first in the string that is\r
transmitted. */\r
- pcExpectedByte = ( signed char * ) comTRANSACTED_STRING;\r
+ pcExpectedByte = comTRANSACTED_STRING;\r
\r
for( ;; )\r
{\r
xState = comtstWAITING_END_OF_STRING;\r
pcExpectedByte++;\r
\r
- /* Block for a short period. This just allows the Rx queue \r
+ /* Block for a short period. This just allows the Rx queue\r
to contain more than one character, and therefore prevent\r
- thrashing reads to the queue, and repetitive context \r
+ thrashing reads to the queue, and repetitive context\r
switches as each character is received. */\r
vTaskDelay( comSHORT_DELAY );\r
}\r
}\r
\r
/* Go back to wait for the start of the next string. */\r
- pcExpectedByte = ( signed char * ) comTRANSACTED_STRING;\r
+ pcExpectedByte = comTRANSACTED_STRING;\r
xState = comtstWAITING_START_OF_STRING;\r
}\r
else\r