This file is part of the FreeRTOS distribution.\r
\r
FreeRTOS is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
+ it under the terms of the GNU General Public License** as published by\r
the Free Software Foundation; either version 2 of the License, or\r
(at your option) any later version.\r
\r
can be applied.\r
\r
***************************************************************************\r
- See http://www.FreeRTOS.org for documentation, latest information, license\r
- and contact details. Please ensure to read the configuration and relevant\r
- port sections of the online documentation.\r
-\r
- Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along\r
- with commercial development and support options.\r
***************************************************************************\r
+ * *\r
+ * Get the FreeRTOS eBook! See http://www.FreeRTOS.org/Documentation *\r
+ * *\r
+ * This is a concise, step by step, 'hands on' guide that describes both *\r
+ * general multitasking concepts and FreeRTOS specifics. It presents and *\r
+ * explains numerous examples that are written using the FreeRTOS API. *\r
+ * Full source code for all the examples is provided in an accompanying *\r
+ * .zip file. *\r
+ * *\r
+ ***************************************************************************\r
+ ***************************************************************************\r
+\r
+ Please ensure to read the configuration and relevant port sections of the\r
+ online documentation.\r
+\r
+ http://www.FreeRTOS.org - Documentation, latest information, license and \r
+ contact details.\r
+\r
+ http://www.SafeRTOS.com - A version that is certified for use in safety \r
+ critical systems.\r
+\r
+ http://www.OpenRTOS.com - Commercial support, development, porting, \r
+ licensing and training services.\r
*/\r
\r
/* ------------------------ MCF523x includes ------------------------------ */\r
\r
/* ------------------------ Begin implementation -------------------------- */\r
xComPortHandle\r
-xSerialPortInitMinimal( unsigned portLONG ulWantedBaud,\r
+xSerialPortInitMinimal( unsigned long ulWantedBaud,\r
unsigned portBASE_TYPE uxQueueLength )\r
{\r
extern void ( *__RAMVEC[] ) ( );\r
\r
/* Create the queues used to hold Rx and Tx characters. */\r
xComPortIF[ 0 ].xRXChars =\r
- xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE )sizeof( signed portCHAR ) );\r
+ xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE )sizeof( signed char ) );\r
xComPortIF[ 0 ].xTXChars =\r
- xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE )sizeof( signed portCHAR ) );\r
+ xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE )sizeof( signed char ) );\r
\r
/* If the queues were created correctly then setup the serial port hardware. */\r
if( ( xComPortIF[ 0 ].xRXChars != 0 ) && ( xComPortIF[ 0 ].xTXChars != 0 ) )\r
}\r
\r
signed portBASE_TYPE\r
-xSerialGetChar( xComPortHandle pxPort, signed portCHAR * pcRxedChar,\r
+xSerialGetChar( xComPortHandle pxPort, signed char * pcRxedChar,\r
portTickType xBlockTime )\r
{\r
int i;\r
}\r
\r
void\r
-vSerialPutString( xComPortHandle pxPort, const signed portCHAR *\r
- const pcString, unsigned portSHORT usStringLength )\r
+vSerialPutString( xComPortHandle pxPort, const signed char *\r
+ const pcString, unsigned short usStringLength )\r
{\r
int i;\r
- signed portCHAR *pChNext;\r
+ signed char *pChNext;\r
\r
/* Send each character in the string, one at a time. */\r
- pChNext = ( signed portCHAR * )pcString;\r
+ pChNext = ( signed char * )pcString;\r
for( i = 0; i < usStringLength; i++ )\r
{\r
/* Block until character has been transmitted. */\r
}\r
\r
signed portBASE_TYPE\r
-xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar,\r
+xSerialPutChar( xComPortHandle pxPort, signed char cOutChar,\r
portTickType xBlockTime )\r
{\r
int i;\r
}\r
\r
signed portBASE_TYPE\r
-xSerialPutCharNOISR( xComPortHandle pxPort, signed portCHAR cOutChar )\r
+xSerialPutCharNOISR( xComPortHandle pxPort, signed char cOutChar )\r
{\r
int i;\r
portBASE_TYPE xResult = pdFALSE;\r
}\r
\r
void\r
-vSerialPutStringNOISR( xComPortHandle pxPort, const signed portCHAR *\r
- const pcString, unsigned portSHORT usStringLength )\r
+vSerialPutStringNOISR( xComPortHandle pxPort, const signed char *\r
+ const pcString, unsigned short usStringLength )\r
{\r
int i;\r
- signed portCHAR *pChNext;\r
+ signed char *pChNext;\r
portBASE_TYPE xOldIPL = portSET_IPL( portIPL_MAX );\r
\r
/* Send each character in the string, one at a time. */\r
- pChNext = ( signed portCHAR * )pcString;\r
+ pChNext = ( signed char * )pcString;\r
for( i = 0; i < usStringLength; i++ )\r
{\r
/* Block until character has been transmitted. */\r
void\r
prvSerialISR( void )\r
{\r
- static signed portCHAR cChar;\r
- static portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;\r
+ static signed char cChar;\r
+ static portBASE_TYPE xHigherPriorityTaskWoken;\r
\r
/* We have to remvoe the effect of the GCC. Please note that the\r
* __attribute__ ((interrupt_handler)) does not work here because we\r
* variable declarations.\r
*/\r
portENTER_SWITCHING_ISR();\r
+ xHigherPriorityTaskWoken = pdFALSE;\r
\r
/* Ready to send a character from the buffer. */\r
if( MCF_UART_USR0 & MCF_UART_USR_TXRDY )\r
{\r
/* Transmit buffer is ready. Test if there are characters available. */\r
- if( xQueueReceiveFromISR( xComPortIF[ 0 ].xTXChars, &cChar, &xTaskWokenByTx ) ==\r
+ if( xQueueReceiveFromISR( xComPortIF[ 0 ].xTXChars, &cChar, &xHigherPriorityTaskWoken ) ==\r
pdTRUE )\r
{\r
/* A character was retrieved from the queue so can be sent. */\r
if( MCF_UART_USR0 & MCF_UART_USR_RXRDY )\r
{\r
cChar = MCF_UART_URB0;\r
- xTaskWokenByRx =\r
- xQueueSendFromISR( xComPortIF[ 0].xRXChars, &cChar, xTaskWokenByRx );\r
+ xQueueSendFromISR( xComPortIF[ 0].xRXChars, &cChar, &xHigherPriorityTaskWoken );\r
}\r
/* Exit the ISR. If a task was woken by either a character being\r
* or transmitted then a context switch will occur.\r
*/\r
- portEXIT_SWITCHING_ISR( ( xTaskWokenByTx || xTaskWokenByRx ) );\r
+ portEXIT_SWITCHING_ISR( xHigherPriorityTaskWoken );\r
}\r