Remove unnecessary use of portLONG, portCHAR and portSHORT.

Change version number in headers.
This commit is contained in:
Richard Barry 2009-10-05 11:10:48 +00:00
parent f625cf929a
commit 9468e36040
126 changed files with 4893 additions and 4768 deletions

View file

@ -1,48 +1,49 @@
/*
FreeRTOS V5.4.2 - Copyright (C) 2009 Real Time Engineers Ltd.
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
This file is part of the FreeRTOS distribution.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation and modified by the FreeRTOS exception.
**NOTE** The exception to the GPL is included to allow you to distribute a
combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation and modified by the FreeRTOS exception.
**NOTE** The exception to the GPL is included to allow you to distribute a
combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
Alternative commercial license and support terms are also available upon
request. See the licensing section of http://www.FreeRTOS.org for full
license details.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
You should have received a copy of the GNU General Public License along
with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
***************************************************************************
* *
* Looking for a quick start? Then check out the FreeRTOS eBook! *
* See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
***************************************************************************
* *
* The FreeRTOS eBook and reference manual are available to purchase for a *
* small fee. Help yourself get started quickly while also helping the *
* FreeRTOS project! See http://www.FreeRTOS.org/Documentation for details *
* *
***************************************************************************
1 tab == 4 spaces!
1 tab == 4 spaces!
Please ensure to read the configuration and relevant port sections of the
online documentation.
Please ensure to read the configuration and relevant port sections of the
online documentation.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
/*
@ -80,13 +81,13 @@ void vSerialRxISR( void );
/* Bit/register definitions. */
#define serINPUT ( 1 )
#define serOUTPUT ( 0 )
#define serTX_ENABLE ( ( unsigned portSHORT ) 1 )
#define serRX_ENABLE ( ( unsigned portSHORT ) 1 )
#define serHIGH_SPEED ( ( unsigned portSHORT ) 1 )
#define serCONTINUOUS_RX ( ( unsigned portSHORT ) 1 )
#define serCLEAR_OVERRUN ( ( unsigned portSHORT ) 0 )
#define serINTERRUPT_ENABLED ( ( unsigned portSHORT ) 1 )
#define serINTERRUPT_DISABLED ( ( unsigned portSHORT ) 0 )
#define serTX_ENABLE ( ( unsigned short ) 1 )
#define serRX_ENABLE ( ( unsigned short ) 1 )
#define serHIGH_SPEED ( ( unsigned short ) 1 )
#define serCONTINUOUS_RX ( ( unsigned short ) 1 )
#define serCLEAR_OVERRUN ( ( unsigned short ) 0 )
#define serINTERRUPT_ENABLED ( ( unsigned short ) 1 )
#define serINTERRUPT_DISABLED ( ( unsigned short ) 0 )
/* All ISR's use the PIC18 low priority interrupt. */
#define serLOW_PRIORITY ( 0 )
@ -99,29 +100,29 @@ static xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned portLONG ulBaud;
unsigned long ulBaud;
/* Calculate the baud rate generator constant.
SPBRG = ( (FOSC / Desired Baud Rate) / 16 ) - 1 */
ulBaud = configCPU_CLOCK_HZ / ulWantedBaud;
ulBaud /= ( unsigned portLONG ) 16;
ulBaud -= ( unsigned portLONG ) 1;
ulBaud /= ( unsigned long ) 16;
ulBaud -= ( unsigned long ) 1;
/* Create the queues used by the ISR's to interface to tasks. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
portENTER_CRITICAL();
{
/* Start with config registers cleared, so we can just set the wanted
bits. */
TXSTA = ( unsigned portSHORT ) 0;
RCSTA = ( unsigned portSHORT ) 0;
TXSTA = ( unsigned short ) 0;
RCSTA = ( unsigned short ) 0;
/* Set the baud rate generator using the above calculated constant. */
SPBRG = ( unsigned portCHAR ) ulBaud;
SPBRG = ( unsigned char ) ulBaud;
/* Setup the IO pins to enable the USART IO. */
serTX_PIN = serOUTPUT;
@ -159,7 +160,7 @@ xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWant
}
/*-----------------------------------------------------------*/
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
{
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
@ -174,7 +175,7 @@ portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar
}
/*-----------------------------------------------------------*/
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
{
/* Return false if after the block time there is no room on the Tx queue. */
if( xQueueSend( xCharsForTx, ( const void * ) &cOutChar, xBlockTime ) != pdPASS )
@ -201,7 +202,7 @@ void vSerialClose( xComPortHandle xPort )
#pragma interruptlow vSerialRxISR save=PRODH, PRODL, TABLAT, section(".tmpdata")
void vSerialRxISR( void )
{
portCHAR cChar;
char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Get the character and post it on the queue of Rxed characters.
@ -228,7 +229,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
#pragma interruptlow vSerialTxISR save=PRODH, PRODL, TABLAT, section(".tmpdata")
void vSerialTxISR( void )
{
portCHAR cChar, cTaskWoken = pdFALSE;
char cChar, cTaskWoken = pdFALSE;
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &cTaskWoken ) == pdTRUE )
{