mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 20:03:50 -04:00
Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
This commit is contained in:
parent
4322b8d649
commit
23a5a73219
59 changed files with 2136 additions and 2087 deletions
|
@ -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.
|
||||
*/
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
|
@ -60,7 +61,7 @@
|
|||
#define configUSE_TICK_HOOK 0
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 ) /* This can be made smaller if required. */
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) /* This can be made smaller if required. */
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -56,7 +57,7 @@
|
|||
/* Demo program include files. */
|
||||
#include "fileio.h"
|
||||
|
||||
void vDisplayMessage( const portCHAR * const pcMessageToPrint )
|
||||
void vDisplayMessage( const char * const pcMessageToPrint )
|
||||
{
|
||||
#ifdef USE_STDIO
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -70,11 +71,11 @@ void vDisplayMessage( const portCHAR * const pcMessageToPrint )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vWriteMessageToDisk( const portCHAR * const pcMessage )
|
||||
void vWriteMessageToDisk( const char * const pcMessage )
|
||||
{
|
||||
#ifdef USE_STDIO
|
||||
const portCHAR * const pcFileName = "c:\\RTOSlog.txt";
|
||||
const portCHAR * const pcSeparator = "\r\n-----------------------\r\n";
|
||||
const char * const pcFileName = "c:\\RTOSlog.txt";
|
||||
const char * const pcSeparator = "\r\n-----------------------\r\n";
|
||||
FILE *pf;
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -82,8 +83,8 @@ FILE *pf;
|
|||
pf = fopen( pcFileName, "a" );
|
||||
if( pf != NULL )
|
||||
{
|
||||
fwrite( pcMessage, strlen( pcMessage ), ( unsigned portSHORT ) 1, pf );
|
||||
fwrite( pcSeparator, strlen( pcSeparator ), ( unsigned portSHORT ) 1, pf );
|
||||
fwrite( pcMessage, strlen( pcMessage ), ( unsigned short ) 1, pf );
|
||||
fwrite( pcSeparator, strlen( pcSeparator ), ( unsigned short ) 1, pf );
|
||||
fclose( pf );
|
||||
}
|
||||
}
|
||||
|
@ -95,10 +96,10 @@ FILE *pf;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vWriteBufferToDisk( const portCHAR * const pcBuffer, unsigned portLONG ulBufferLength )
|
||||
void vWriteBufferToDisk( const char * const pcBuffer, unsigned long ulBufferLength )
|
||||
{
|
||||
#ifdef USE_STDIO
|
||||
const portCHAR * const pcFileName = "c:\\trace.bin";
|
||||
const char * const pcFileName = "c:\\trace.bin";
|
||||
FILE *pf;
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -106,7 +107,7 @@ FILE *pf;
|
|||
pf = fopen( pcFileName, "wb" );
|
||||
if( pf )
|
||||
{
|
||||
fwrite( pcBuffer, ( size_t ) ulBufferLength, ( unsigned portSHORT ) 1, pf );
|
||||
fwrite( pcBuffer, ( size_t ) ulBufferLength, ( unsigned short ) 1, pf );
|
||||
fclose( pf );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
#ifndef FREERTOS_CONFIG_H
|
||||
|
@ -68,7 +69,7 @@
|
|||
#define configUSE_TICK_HOOK 0
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 10 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 128 ) /* This can be made smaller if required. */
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) /* This can be made smaller if required. */
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 32 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 0
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -61,14 +62,14 @@ Changes from V2.0.0
|
|||
#include "task.h"
|
||||
#include "partest.h"
|
||||
|
||||
#define partstALL_OUTPUTS_OFF ( ( unsigned portSHORT) 0x00 )
|
||||
#define partstMAX_OUTPUT_LED ( ( unsigned portCHAR ) 7 )
|
||||
#define partstPORT_F_ADDR ( ( unsigned portSHORT ) 0x605 )
|
||||
#define partstPORT_DIRECTION_REG ( ( unsigned portSHORT ) 0x606 )
|
||||
#define partstPORT_F_DIR_BIT ( ( unsigned portSHORT ) 0x20 )
|
||||
#define partstALL_OUTPUTS_OFF ( ( unsigned short) 0x00 )
|
||||
#define partstMAX_OUTPUT_LED ( ( unsigned char ) 7 )
|
||||
#define partstPORT_F_ADDR ( ( unsigned short ) 0x605 )
|
||||
#define partstPORT_DIRECTION_REG ( ( unsigned short ) 0x606 )
|
||||
#define partstPORT_F_DIR_BIT ( ( unsigned short ) 0x20 )
|
||||
|
||||
/*lint -e956 File scope parameters okay here. */
|
||||
static volatile unsigned portCHAR ucCurrentOutputValue = partstALL_OUTPUTS_OFF;
|
||||
static volatile unsigned char ucCurrentOutputValue = partstALL_OUTPUTS_OFF;
|
||||
/*lint +e956 */
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
|
@ -77,7 +78,7 @@ static volatile unsigned portCHAR ucCurrentOutputValue = partstALL_OUTPUTS_OFF;
|
|||
|
||||
void vParTestInitialise( void )
|
||||
{
|
||||
unsigned portSHORT usInput;
|
||||
unsigned short usInput;
|
||||
|
||||
ucCurrentOutputValue = partstALL_OUTPUTS_OFF;
|
||||
|
||||
|
@ -93,7 +94,7 @@ unsigned portSHORT usInput;
|
|||
|
||||
void vParTestSetLED( unsigned portBASE_TYPE uxLED, portBASE_TYPE xValue )
|
||||
{
|
||||
unsigned portCHAR ucBit = ( unsigned portCHAR ) 1;
|
||||
unsigned char ucBit = ( unsigned char ) 1;
|
||||
|
||||
if( uxLED <= partstMAX_OUTPUT_LED )
|
||||
{
|
||||
|
@ -104,7 +105,7 @@ unsigned portCHAR ucBit = ( unsigned portCHAR ) 1;
|
|||
{
|
||||
if( xValue == pdTRUE )
|
||||
{
|
||||
ucBit ^= ( unsigned portCHAR ) 0xff;
|
||||
ucBit ^= ( unsigned char ) 0xff;
|
||||
ucCurrentOutputValue &= ucBit;
|
||||
}
|
||||
else
|
||||
|
@ -120,11 +121,11 @@ unsigned portCHAR ucBit = ( unsigned portCHAR ) 1;
|
|||
|
||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
|
||||
{
|
||||
unsigned portCHAR ucBit;
|
||||
unsigned char ucBit;
|
||||
|
||||
if( uxLED <= partstMAX_OUTPUT_LED )
|
||||
{
|
||||
ucBit = ( ( unsigned portCHAR ) 1 ) << uxLED;
|
||||
ucBit = ( ( unsigned char ) 1 ) << uxLED;
|
||||
|
||||
vTaskSuspendAll();
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -96,7 +97,7 @@ Changes from V1.2.5
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned portLONG.
|
||||
portTickType rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -126,12 +127,12 @@ Changes from V2.0.0
|
|||
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define mainSEMAPHORE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
|
||||
#define mainPRINT_STACK_SIZE ( ( unsigned portSHORT ) 256 )
|
||||
#define mainDEBUG_LOG_BUFFER_SIZE ( ( unsigned portSHORT ) 20480 )
|
||||
#define mainPRINT_STACK_SIZE ( ( unsigned short ) 256 )
|
||||
#define mainDEBUG_LOG_BUFFER_SIZE ( ( unsigned short ) 20480 )
|
||||
|
||||
/* Constant definitions for accessing the build in LED on the Flashlite 186. */
|
||||
#define mainLED_REG_DIR ( ( unsigned portSHORT ) 0xff78 )
|
||||
#define mainLED_REG ( ( unsigned portSHORT ) 0xff7a )
|
||||
#define mainLED_REG_DIR ( ( unsigned short ) 0xff78 )
|
||||
#define mainLED_REG ( ( unsigned short ) 0xff7a )
|
||||
|
||||
/* If an error is detected in a task then the vErrorChecks() task will enter
|
||||
an infinite loop flashing the LED at this rate. */
|
||||
|
@ -153,10 +154,10 @@ the scheduler. */
|
|||
static void prvCheckForKeyPresses( void );
|
||||
|
||||
/* Buffer used by the trace visualisation utility. */
|
||||
static portCHAR pcWriteBuffer[ mainDEBUG_LOG_BUFFER_SIZE ];
|
||||
static char pcWriteBuffer[ mainDEBUG_LOG_BUFFER_SIZE ];
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
portSHORT main( void )
|
||||
short main( void )
|
||||
{
|
||||
/* Initialise hardware and utilities. */
|
||||
vParTestInitialise();
|
||||
|
@ -191,11 +192,11 @@ static void vErrorChecks( void *pvParameters )
|
|||
{
|
||||
portTickType xExpectedWakeTime;
|
||||
const portTickType xPrintRate = ( portTickType ) 5000 / portTICK_RATE_MS;
|
||||
const portLONG lMaxAllowableTimeDifference = ( portLONG ) 0;
|
||||
const long lMaxAllowableTimeDifference = ( long ) 0;
|
||||
portTickType xWakeTime;
|
||||
portLONG lTimeDifference;
|
||||
const portCHAR *pcReceivedMessage;
|
||||
const portCHAR * const pcTaskBlockedTooLongMsg = "Print task blocked too long!\r\n";
|
||||
long lTimeDifference;
|
||||
const char *pcReceivedMessage;
|
||||
const char * const pcTaskBlockedTooLongMsg = "Print task blocked too long!\r\n";
|
||||
|
||||
/* Stop warnings. */
|
||||
( void ) pvParameters;
|
||||
|
@ -226,11 +227,11 @@ const portCHAR * const pcTaskBlockedTooLongMsg = "Print task blocked too long!\r
|
|||
time we should have unblocked. */
|
||||
if( xWakeTime > xExpectedWakeTime )
|
||||
{
|
||||
lTimeDifference = ( portLONG ) ( xWakeTime - xExpectedWakeTime );
|
||||
lTimeDifference = ( long ) ( xWakeTime - xExpectedWakeTime );
|
||||
}
|
||||
else
|
||||
{
|
||||
lTimeDifference = ( portLONG ) ( xExpectedWakeTime - xWakeTime );
|
||||
lTimeDifference = ( long ) ( xExpectedWakeTime - xWakeTime );
|
||||
}
|
||||
|
||||
if( lTimeDifference > lMaxAllowableTimeDifference )
|
||||
|
@ -261,7 +262,7 @@ static void prvCheckForKeyPresses( void )
|
|||
{
|
||||
#ifdef USE_STDIO
|
||||
|
||||
portSHORT sIn;
|
||||
short sIn;
|
||||
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -270,7 +271,7 @@ static void prvCheckForKeyPresses( void )
|
|||
|
||||
if( sIn )
|
||||
{
|
||||
unsigned portLONG ulBufferLength;
|
||||
unsigned long ulBufferLength;
|
||||
|
||||
/* Key presses can be used to start/stop the trace utility, or end the
|
||||
program. */
|
||||
|
@ -305,7 +306,7 @@ static void prvCheckForKeyPresses( void )
|
|||
|
||||
static void prvCheckOtherTasksAreStillRunning( void )
|
||||
{
|
||||
portSHORT sErrorHasOccurred = pdFALSE;
|
||||
short sErrorHasOccurred = pdFALSE;
|
||||
|
||||
if( xAreComTestTasksStillRunning() != pdTRUE )
|
||||
{
|
||||
|
@ -365,8 +366,8 @@ portSHORT sErrorHasOccurred = pdFALSE;
|
|||
|
||||
static void prvInitLED( void )
|
||||
{
|
||||
unsigned portSHORT usPortDirection;
|
||||
const unsigned portSHORT usLEDOut = 0x400;
|
||||
unsigned short usPortDirection;
|
||||
const unsigned short usLEDOut = 0x400;
|
||||
|
||||
/* Set the LED bit to an output. */
|
||||
|
||||
|
@ -378,9 +379,9 @@ const unsigned portSHORT usLEDOut = 0x400;
|
|||
|
||||
static void prvToggleLED( void )
|
||||
{
|
||||
static portSHORT sLED = pdTRUE;
|
||||
unsigned portSHORT usLEDState;
|
||||
const unsigned portSHORT usLEDBit = 0x400;
|
||||
static short sLED = pdTRUE;
|
||||
unsigned short usLEDState;
|
||||
const unsigned short usLEDBit = 0x400;
|
||||
|
||||
/* Flip the state of the LED. */
|
||||
usLEDState = inpw( mainLED_REG );
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -90,7 +91,7 @@ Changes from V2.0.0
|
|||
#include "portasm.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#define serMAX_PORTS ( ( unsigned portSHORT ) 2 )
|
||||
#define serMAX_PORTS ( ( unsigned short ) 2 )
|
||||
|
||||
#define serPORT_0_INT_REG ( 0xff44 )
|
||||
#define serPORT_0_BAUD_REG ( 0xff88 )
|
||||
|
@ -108,19 +109,19 @@ Changes from V2.0.0
|
|||
#define serPORT_1_CTRL_REG ( 0xff10 )
|
||||
#define serPORT_1_IRQ ( 0x11 )
|
||||
|
||||
#define serTX_EMPTY ( ( unsigned portSHORT ) 0x40 )
|
||||
#define serRX_READY ( ( unsigned portSHORT ) 0x80 )
|
||||
#define serTX_EMPTY ( ( unsigned short ) 0x40 )
|
||||
#define serRX_READY ( ( unsigned short ) 0x80 )
|
||||
|
||||
#define serRESET_PIC( usEOI_TYPE ) portOUTPUT_WORD( ( unsigned portSHORT ) 0xff22, usEOI_TYPE )
|
||||
#define serTX_HOLD_EMPTY_INT ( ( unsigned portSHORT ) 0x100 )
|
||||
#define serRESET_PIC( usEOI_TYPE ) portOUTPUT_WORD( ( unsigned short ) 0xff22, usEOI_TYPE )
|
||||
#define serTX_HOLD_EMPTY_INT ( ( unsigned short ) 0x100 )
|
||||
|
||||
#define serENABLE_INTERRUPTS ( ( unsigned portSHORT ) 0x80 )
|
||||
#define serMODE ( ( unsigned portSHORT ) 0x01 )
|
||||
#define serENABLE_TX_MACHINES ( ( unsigned portSHORT ) 0x40 )
|
||||
#define serENABLE_RX_MACHINES ( ( unsigned portSHORT ) 0x20 )
|
||||
#define serINTERRUPT_MASK ( ( unsigned portSHORT ) 0x08 )
|
||||
#define serCLEAR_ALL_STATUS_BITS ( ( unsigned portSHORT ) 0x00 )
|
||||
#define serINTERRUPT_PRIORITY ( ( unsigned portSHORT ) 0x01 ) /*< Just below the scheduler priority. */
|
||||
#define serENABLE_INTERRUPTS ( ( unsigned short ) 0x80 )
|
||||
#define serMODE ( ( unsigned short ) 0x01 )
|
||||
#define serENABLE_TX_MACHINES ( ( unsigned short ) 0x40 )
|
||||
#define serENABLE_RX_MACHINES ( ( unsigned short ) 0x20 )
|
||||
#define serINTERRUPT_MASK ( ( unsigned short ) 0x08 )
|
||||
#define serCLEAR_ALL_STATUS_BITS ( ( unsigned short ) 0x00 )
|
||||
#define serINTERRUPT_PRIORITY ( ( unsigned short ) 0x01 ) /*< Just below the scheduler priority. */
|
||||
|
||||
#define serDONT_BLOCK ( ( portTickType ) 0 )
|
||||
|
||||
|
@ -181,7 +182,7 @@ typedef enum
|
|||
} eBaud;
|
||||
|
||||
/* Must be same order as eBaud definitions. */
|
||||
static const unsigned portSHORT usBaudRateDivisor[] =
|
||||
static const unsigned short usBaudRateDivisor[] =
|
||||
{
|
||||
0, /* Not sure if the first 6 are correct. First cannot be used. */
|
||||
29127,
|
||||
|
@ -206,15 +207,15 @@ static const unsigned portSHORT usBaudRateDivisor[] =
|
|||
typedef struct xCOM_PORT
|
||||
{
|
||||
/* Hardware parameters for this port. */
|
||||
portSHORT sTxInterruptOn;
|
||||
unsigned portSHORT usIntReg;
|
||||
unsigned portSHORT usBaudReg;
|
||||
unsigned portSHORT usRxReg;
|
||||
unsigned portSHORT usTxReg;
|
||||
unsigned portSHORT usStatusReg;
|
||||
unsigned portSHORT usCtrlReg;
|
||||
short sTxInterruptOn;
|
||||
unsigned short usIntReg;
|
||||
unsigned short usBaudReg;
|
||||
unsigned short usRxReg;
|
||||
unsigned short usTxReg;
|
||||
unsigned short usStatusReg;
|
||||
unsigned short usCtrlReg;
|
||||
|
||||
unsigned portSHORT usIRQVector;
|
||||
unsigned short usIRQVector;
|
||||
|
||||
/* Queues used for communications with com test task. */
|
||||
xQueueHandle xRxedChars;
|
||||
|
@ -237,17 +238,17 @@ typedef xComPort * xComPortHandle;
|
|||
/* These prototypes are repeated here so we don't have to include the serial header. This allows
|
||||
the xComPortHandle structure details to be private to this file. */
|
||||
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength );
|
||||
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, portCHAR *pcRxedChar, portTickType xBlockTime );
|
||||
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, portCHAR cOutChar, portTickType xBlockTime );
|
||||
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, char *pcRxedChar, portTickType xBlockTime );
|
||||
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, char cOutChar, portTickType xBlockTime );
|
||||
void vSerialClose( xComPortHandle xPort );
|
||||
portSHORT sSerialWaitForSemaphore( xComPortHandle xPort );
|
||||
short sSerialWaitForSemaphore( xComPortHandle xPort );
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portSHORT xComPortISR( xComPort * const pxPort );
|
||||
static short xComPortISR( xComPort * const pxPort );
|
||||
|
||||
#define vInterruptOn( pxPort, usInterrupt ) \
|
||||
{ \
|
||||
unsigned portSHORT usIn; \
|
||||
unsigned short usIn; \
|
||||
\
|
||||
portENTER_CRITICAL(); \
|
||||
{ \
|
||||
|
@ -265,7 +266,7 @@ unsigned portSHORT usIn; \
|
|||
|
||||
#define vInterruptOff( pxPort, usInterrupt ) \
|
||||
{ \
|
||||
unsigned portSHORT usIn = portINPUT_WORD( pxPort->usCtrlReg ); \
|
||||
unsigned short usIn = portINPUT_WORD( pxPort->usCtrlReg ); \
|
||||
if( usIn & usInterrupt ) \
|
||||
{ \
|
||||
portOUTPUT_WORD( pxPort->usCtrlReg, usIn & ~usInterrupt); \
|
||||
|
@ -300,7 +301,7 @@ static pxISR xISRs[ serMAX_PORTS ] =
|
|||
|
||||
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength )
|
||||
{
|
||||
unsigned portSHORT usPort;
|
||||
unsigned short usPort;
|
||||
xComPortHandle pxPort = NULL;
|
||||
|
||||
/* BAUDDIV = ( Microprocessor Clock / Baud Rate ) / 16 */
|
||||
|
@ -313,7 +314,7 @@ xComPortHandle pxPort = NULL;
|
|||
|
||||
/* Currently only n,8,1 is supported. */
|
||||
|
||||
usPort = ( unsigned portSHORT ) ePort;
|
||||
usPort = ( unsigned short ) ePort;
|
||||
|
||||
if( usPort < serMAX_PORTS )
|
||||
{
|
||||
|
@ -321,17 +322,17 @@ xComPortHandle pxPort = NULL;
|
|||
|
||||
portENTER_CRITICAL();
|
||||
{
|
||||
unsigned portSHORT usInWord;
|
||||
unsigned short usInWord;
|
||||
|
||||
/* Create the queues used by the com test task. */
|
||||
pxPort->xRxedChars = xQueueCreate( uxBufferLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
|
||||
pxPort->xCharsForTx = xQueueCreate( uxBufferLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
|
||||
pxPort->xRxedChars = xQueueCreate( uxBufferLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
|
||||
pxPort->xCharsForTx = xQueueCreate( uxBufferLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
|
||||
|
||||
/* Create the test semaphore. This does nothing useful except test a feature of the scheduler. */
|
||||
vSemaphoreCreateBinary( pxPort->xTestSem );
|
||||
|
||||
/* There is no ISR here already to restore later. */
|
||||
_dos_setvect( ( portSHORT ) pxPort->usIRQVector, xISRs[ usPort ] );
|
||||
_dos_setvect( ( short ) pxPort->usIRQVector, xISRs[ usPort ] );
|
||||
|
||||
usInWord = portINPUT_WORD( pxPort->usIntReg );
|
||||
usInWord &= ~serINTERRUPT_MASK;
|
||||
|
@ -350,12 +351,12 @@ xComPortHandle pxPort = NULL;
|
|||
} /*lint !e715 Some parameters are not used as only a subset of the serial port functionality is currently implemented. */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vSerialPutString( xComPortHandle pxPort, const portCHAR * const pcString, unsigned portSHORT usStringLength )
|
||||
void vSerialPutString( xComPortHandle pxPort, const char * const pcString, unsigned short usStringLength )
|
||||
{
|
||||
unsigned portSHORT usByte;
|
||||
portCHAR *pcNextChar;
|
||||
unsigned short usByte;
|
||||
char *pcNextChar;
|
||||
|
||||
pcNextChar = ( portCHAR * ) pcString;
|
||||
pcNextChar = ( char * ) pcString;
|
||||
|
||||
for( usByte = 0; usByte < usStringLength; usByte++ )
|
||||
{
|
||||
|
@ -367,7 +368,7 @@ portCHAR *pcNextChar;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, portCHAR *pcRxedChar, portTickType xBlockTime )
|
||||
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, char *pcRxedChar, portTickType xBlockTime )
|
||||
{
|
||||
/* Get the next character from the buffer, note that this routine is only
|
||||
called having checked that the is (at least) one to get */
|
||||
|
@ -382,7 +383,7 @@ portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, portCHAR *pcRxedChar, portT
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, portCHAR cOutChar, portTickType xBlockTime )
|
||||
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, char cOutChar, portTickType xBlockTime )
|
||||
{
|
||||
if( xQueueSend( pxPort->xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
|
||||
{
|
||||
|
@ -407,7 +408,7 @@ const portTickType xBlockTime = ( portTickType ) 0xffff;
|
|||
|
||||
void vSerialClose( xComPortHandle xPort )
|
||||
{
|
||||
unsigned portSHORT usOutput;
|
||||
unsigned short usOutput;
|
||||
|
||||
/* Turn off the interrupts. We may also want to delete the queues and/or
|
||||
re-install the original ISR. */
|
||||
|
@ -431,8 +432,8 @@ unsigned portSHORT usOutput;
|
|||
|
||||
static portBASE_TYPE xComPortISR( xComPort * const pxPort )
|
||||
{
|
||||
unsigned portSHORT usStatusRegister;
|
||||
portCHAR cChar;
|
||||
unsigned short usStatusRegister;
|
||||
char cChar;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, xContinue = pdTRUE;
|
||||
|
||||
/* NOTE: THIS IS NOT AN EFFICIENT ISR AS IT IS DESIGNED SOLELY TO TEST
|
||||
|
@ -447,7 +448,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, xContinue = pdTRUE;
|
|||
|
||||
if( usStatusRegister & serRX_READY )
|
||||
{
|
||||
cChar = ( portCHAR ) portINPUT_WORD( pxPort->usRxReg );
|
||||
cChar = ( char ) portINPUT_WORD( pxPort->usRxReg );
|
||||
xQueueSendFromISR( pxPort->xRxedChars, &cChar, &xHigherPriorityTaskWoken );
|
||||
|
||||
/* Also release the semaphore - this does nothing interesting and is just a test. */
|
||||
|
@ -461,7 +462,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, xContinue = pdTRUE;
|
|||
{
|
||||
if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
|
||||
{
|
||||
portOUTPUT_WORD( pxPort->usTxReg, ( unsigned portSHORT ) cChar );
|
||||
portOUTPUT_WORD( pxPort->usTxReg, ( unsigned short ) cChar );
|
||||
|
||||
/* We have performed an action this cycle - there may be others to perform. */
|
||||
xContinue = pdTRUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue