]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/msp430_IAR/serial/serial.c
Update version number to 8.1.1 for patch release that re-enables mutexes to be given...
[freertos] / FreeRTOS / Demo / msp430_IAR / serial / serial.c
index fe9923ef51c965e550170584ff37db2f87e8be9a..59f7a1b3afb7eacba1beec416faee2ca27d4f9a4 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
-    FreeRTOS V7.5.1 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.1.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
 \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
 #include "serial.h"\r
 \r
 /* Constants required to setup the hardware. */\r
-#define serTX_AND_RX                   ( ( unsigned portCHAR ) 0x03 )\r
+#define serTX_AND_RX                   ( ( unsigned char ) 0x03 )\r
 \r
 /* Misc. constants. */\r
-#define serNO_BLOCK                            ( ( portTickType ) 0 )\r
+#define serNO_BLOCK                            ( ( TickType_t ) 0 )\r
 \r
 /* Enable the UART Tx interrupt. */\r
 #define vInterruptOn() IFG2 |= UTXIFG1\r
 \r
 /* The queue used to hold received characters. */\r
-static xQueueHandle xRxedChars;\r
+static QueueHandle_t xRxedChars;\r
 \r
 /* The queue used to hold characters waiting transmission. */\r
-static xQueueHandle xCharsForTx;\r
+static QueueHandle_t xCharsForTx;\r
 \r
-static volatile portSHORT sTHREEmpty;\r
+static volatile short sTHREEmpty;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
-xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )\r
+xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )\r
 {\r
-unsigned portLONG ulBaudRateCount;\r
+unsigned long ulBaudRateCount;\r
 \r
        /* Initialise the hardware. */\r
 \r
@@ -110,8 +111,8 @@ unsigned portLONG ulBaudRateCount;
        portENTER_CRITICAL();\r
        {\r
                /* Create the queues used by the com test task. */\r
-               xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );\r
-               xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );\r
+               xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );\r
+               xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );\r
 \r
                /* Reset UART. */\r
                UCTL1 |= SWRST;\r
@@ -125,11 +126,11 @@ unsigned portLONG ulBaudRateCount;
                U1TCTL |= SSEL1;\r
 \r
                /* Setup baud rate low byte. */\r
-               U1BR0 = ( unsigned portCHAR ) ( ulBaudRateCount & ( unsigned portLONG ) 0xff );\r
+               U1BR0 = ( unsigned char ) ( ulBaudRateCount & ( unsigned long ) 0xff );\r
 \r
                /* Setup baud rate high byte. */\r
                ulBaudRateCount >>= 8UL;\r
-               U1BR1 = ( unsigned portCHAR ) ( ulBaudRateCount & ( unsigned portLONG ) 0xff );\r
+               U1BR1 = ( unsigned char ) ( ulBaudRateCount & ( unsigned long ) 0xff );\r
 \r
                /* Enable ports. */\r
                ME2 |= UTXE1 + URXE1;\r
@@ -152,7 +153,7 @@ unsigned portLONG ulBaudRateCount;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )\r
+signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime )\r
 {\r
        /* Get the next character from the buffer.  Return false if no characters\r
        are available, or arrive before xBlockTime expires. */\r
@@ -167,7 +168,7 @@ signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcR
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )\r
+signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 \r
@@ -223,7 +224,7 @@ signed portBASE_TYPE xReturn;
        #pragma vector=UART1RX_VECTOR\r
        __interrupt void vRxISR( void )\r
        {\r
-       signed portCHAR cChar;\r
+       signed char cChar;\r
        portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
        \r
                /* Get the character from the UART and post it on the queue of Rxed\r
@@ -251,7 +252,7 @@ signed portBASE_TYPE xReturn;
        #pragma vector=UART1TX_VECTOR\r
        __interrupt void vTxISR( void )\r
        {\r
-       signed portCHAR cChar;\r
+       signed char cChar;\r
        portBASE_TYPE xTaskWoken = pdFALSE;\r
        \r
                /* The previous character has been transmitted.  See if there are any\r
@@ -279,7 +280,7 @@ signed portBASE_TYPE xReturn;
     interrupt entry point. */\r
        void vRxISR( void )\r
        {\r
-       signed portCHAR cChar;\r
+       signed char cChar;\r
        portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
        \r
                /* Get the character from the UART and post it on the queue of Rxed\r
@@ -299,7 +300,7 @@ signed portBASE_TYPE xReturn;
     interrupt entry point. */\r
        void vTxISR( void )\r
        {\r
-       signed portCHAR cChar;\r
+       signed char cChar;\r
        portBASE_TYPE xTaskWoken = pdFALSE;\r
        \r
                /* The previous character has been transmitted.  See if there are any\r