mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Remove unnecessary use of portLONG, portCHAR and portSHORT.
Change version number in headers.
This commit is contained in:
parent
f625cf929a
commit
9468e36040
126 changed files with 4893 additions and 4768 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
|
||||
|
@ -63,10 +64,10 @@
|
|||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#define configUSE_TICK_HOOK 0
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 80000000 )
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned long ) 80000000 )
|
||||
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
|
||||
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 256 ) /* This can be made smaller if required. */
|
||||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* This can be made smaller if required. */
|
||||
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 20 * 1024 ) )
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_TRACE_FACILITY 1
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -73,14 +74,14 @@
|
|||
#define httpTX_WAIT 2
|
||||
|
||||
/* Network address configuration. */
|
||||
const unsigned portCHAR ucMacAddress[] = { 12, 128, 12, 34, 56, 78 };
|
||||
const unsigned portCHAR ucGatewayAddress[] = { 192, 168, 2, 1 };
|
||||
const unsigned portCHAR ucIPAddress[] = { 172, 25, 218, 210 };
|
||||
const unsigned portCHAR ucSubnetMask[] = { 255, 255, 255, 0 };
|
||||
const unsigned char ucMacAddress[] = { 12, 128, 12, 34, 56, 78 };
|
||||
const unsigned char ucGatewayAddress[] = { 192, 168, 2, 1 };
|
||||
const unsigned char ucIPAddress[] = { 172, 25, 218, 210 };
|
||||
const unsigned char ucSubnetMask[] = { 255, 255, 255, 0 };
|
||||
|
||||
/* The number of sockets this task is going to handle. */
|
||||
#define httpSOCKET_NUM 3
|
||||
unsigned portCHAR ucConnection[ httpSOCKET_NUM ];
|
||||
unsigned char ucConnection[ httpSOCKET_NUM ];
|
||||
|
||||
/* The maximum data buffer size we can handle. */
|
||||
#define httpSOCKET_BUFFER_SIZE 2048
|
||||
|
@ -116,16 +117,16 @@ static void prvNetifInit( void );
|
|||
* Generate the dynamic components of the served WEB page and transmit the
|
||||
* entire page through the socket.
|
||||
*/
|
||||
static void prvTransmitHTTP( unsigned portCHAR socket );
|
||||
static void prvTransmitHTTP( unsigned char socket );
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* This variable is simply incremented by the idle task hook so the number of
|
||||
iterations the idle task has performed can be displayed as part of the served
|
||||
page. */
|
||||
unsigned portLONG ulIdleLoops = 0UL;
|
||||
unsigned long ulIdleLoops = 0UL;
|
||||
|
||||
/* Data buffer shared by sockets. */
|
||||
unsigned portCHAR ucSocketBuffer[ httpSOCKET_BUFFER_SIZE ];
|
||||
unsigned char ucSocketBuffer[ httpSOCKET_BUFFER_SIZE ];
|
||||
|
||||
/* The semaphore used by the Ethernet ISR to signal that the task should wake
|
||||
and process whatever caused the interrupt. */
|
||||
|
@ -134,8 +135,8 @@ xSemaphoreHandle xTCPSemaphore = NULL;
|
|||
/*-----------------------------------------------------------*/
|
||||
void vHTTPTask( void * pvParameters )
|
||||
{
|
||||
portSHORT i, sLen;
|
||||
unsigned portCHAR ucState;
|
||||
short i, sLen;
|
||||
unsigned char ucState;
|
||||
|
||||
( void ) pvParameters;
|
||||
|
||||
|
@ -202,7 +203,7 @@ unsigned portCHAR ucState;
|
|||
|
||||
static void prvHTTPInit( void )
|
||||
{
|
||||
unsigned portCHAR ucIndex;
|
||||
unsigned char ucIndex;
|
||||
|
||||
/* There are 4 total sockets available; we will claim 3 for HTTP. */
|
||||
for(ucIndex = 0; ucIndex < httpSOCKET_NUM; ucIndex++)
|
||||
|
@ -219,10 +220,10 @@ static void prvNetifInit( void )
|
|||
i2chip_init();
|
||||
initW3100A();
|
||||
|
||||
setMACAddr( ( unsigned portCHAR * ) ucMacAddress );
|
||||
setgateway( ( unsigned portCHAR * ) ucGatewayAddress );
|
||||
setsubmask( ( unsigned portCHAR * ) ucSubnetMask );
|
||||
setIP( ( unsigned portCHAR * ) ucIPAddress );
|
||||
setMACAddr( ( unsigned char * ) ucMacAddress );
|
||||
setgateway( ( unsigned char * ) ucGatewayAddress );
|
||||
setsubmask( ( unsigned char * ) ucSubnetMask );
|
||||
setIP( ( unsigned char * ) ucIPAddress );
|
||||
|
||||
/* See definition of 'sysinit' in socket.c
|
||||
- 8 KB transmit buffer, and 8 KB receive buffer available. These buffers
|
||||
|
@ -233,41 +234,41 @@ static void prvNetifInit( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvTransmitHTTP(unsigned portCHAR socket)
|
||||
static void prvTransmitHTTP(unsigned char socket)
|
||||
{
|
||||
extern portSHORT usCheckStatus;
|
||||
extern short usCheckStatus;
|
||||
|
||||
/* Send the http and html headers. */
|
||||
send( socket, ( unsigned portCHAR * ) httpOUTPUT_OK, strlen( httpOUTPUT_OK ) );
|
||||
send( socket, ( unsigned portCHAR * ) HTML_OUTPUT_BEGIN, strlen( HTML_OUTPUT_BEGIN ) );
|
||||
send( socket, ( unsigned char * ) httpOUTPUT_OK, strlen( httpOUTPUT_OK ) );
|
||||
send( socket, ( unsigned char * ) HTML_OUTPUT_BEGIN, strlen( HTML_OUTPUT_BEGIN ) );
|
||||
|
||||
/* Generate then send the table showing the status of each task. */
|
||||
vTaskList( ucSocketBuffer );
|
||||
send( socket, ( unsigned portCHAR * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
|
||||
/* Send the number of times the idle task has looped. */
|
||||
sprintf( ucSocketBuffer, "</pre></font><p><br>The idle task has looped 0x%08lx times<br>", ulIdleLoops );
|
||||
send( socket, ( unsigned portCHAR * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
|
||||
/* Send the tick count. */
|
||||
sprintf( ucSocketBuffer, "The tick count is 0x%08lx<br>", xTaskGetTickCount() );
|
||||
send( socket, ( unsigned portCHAR * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
|
||||
/* Show a message indicating whether or not the check task has discovered
|
||||
an error in any of the standard demo tasks. */
|
||||
if( usCheckStatus == 0 )
|
||||
{
|
||||
sprintf( ucSocketBuffer, "No errors detected." );
|
||||
send( socket, ( unsigned portCHAR * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( ucSocketBuffer, "<font color=\"red\">An error has been detected in at least one task %x.</font><p>", usCheckStatus );
|
||||
send( socket, ( unsigned portCHAR * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
send( socket, ( unsigned char * ) ucSocketBuffer, strlen( ucSocketBuffer ) );
|
||||
}
|
||||
|
||||
/* Finish the page off. */
|
||||
send( socket, (unsigned portCHAR*)HTML_OUTPUT_END, strlen(HTML_OUTPUT_END));
|
||||
send( socket, (unsigned char*)HTML_OUTPUT_END, strlen(HTML_OUTPUT_END));
|
||||
|
||||
/* Must make sure the data is gone before closing the socket. */
|
||||
while( !tx_empty( socket ) )
|
||||
|
|
|
@ -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 HTTP_TASK_H
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -87,7 +88,7 @@
|
|||
/* Used to indicate the error status. A value of 0 means that an error has not
|
||||
been detected in any task. A non zero value indicates which group of demo
|
||||
tasks has reported an error. See prvCheckTask() for bit definitions. */
|
||||
unsigned portSHORT usCheckStatus = 0;
|
||||
unsigned short usCheckStatus = 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -193,7 +194,7 @@ static void prvCheckTask( void *pvParameters )
|
|||
|
||||
/* This is included to prevent link errors - allowing the 'full' version of
|
||||
the comtest tasks to be used. It can be ignored. */
|
||||
void vPrintDisplayMessage( const portCHAR * const * ppcMessageToSend )
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend )
|
||||
{
|
||||
( void ) ppcMessageToSend;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -54,7 +55,7 @@
|
|||
#include "task.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 )
|
||||
|
@ -72,19 +73,19 @@
|
|||
#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 )
|
||||
|
||||
|
@ -147,15 +148,15 @@ typedef enum
|
|||
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;
|
||||
|
@ -178,22 +179,22 @@ typedef xComPort * xComPortHandle;
|
|||
/**
|
||||
* Lookup the baud rate from the enum.
|
||||
*/
|
||||
static unsigned portLONG prvBaud( eBaud eWantedBaud );
|
||||
static unsigned long prvBaud( eBaud eWantedBaud );
|
||||
|
||||
/* 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(); \
|
||||
{ \
|
||||
|
@ -211,7 +212,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); \
|
||||
|
@ -244,7 +245,7 @@ static pxISR xISRs[ serMAX_PORTS ] =
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static unsigned portLONG prvBaud( eBaud eWantedBaud )
|
||||
static unsigned long prvBaud( eBaud eWantedBaud )
|
||||
{
|
||||
switch( eWantedBaud )
|
||||
{
|
||||
|
@ -272,9 +273,9 @@ static unsigned portLONG prvBaud( eBaud eWantedBaud )
|
|||
|
||||
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;
|
||||
unsigned portLONG ulBaudDiv;
|
||||
unsigned long ulBaudDiv;
|
||||
|
||||
/* BAUDDIV = ( Microprocessor Clock / Baud Rate ) / 16 */
|
||||
ulBaudDiv = ( configCPU_CLOCK_HZ / prvBaud( eWantedBaud ) ) / 16UL;
|
||||
|
@ -287,7 +288,7 @@ unsigned portLONG ulBaudDiv;
|
|||
|
||||
/* Currently only n,8,1 is supported. */
|
||||
|
||||
usPort = ( unsigned portSHORT ) ePort;
|
||||
usPort = ( unsigned short ) ePort;
|
||||
|
||||
if( usPort < serMAX_PORTS )
|
||||
{
|
||||
|
@ -295,24 +296,24 @@ unsigned portLONG ulBaudDiv;
|
|||
|
||||
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. */
|
||||
setvect( ( portSHORT ) pxPort->usIRQVector, xISRs[ usPort ] );
|
||||
setvect( ( short ) pxPort->usIRQVector, xISRs[ usPort ] );
|
||||
|
||||
usInWord = portINPUT_WORD( pxPort->usIntReg );
|
||||
usInWord &= ~serINTERRUPT_MASK;
|
||||
usInWord |= serINTERRUPT_PRIORITY;
|
||||
portOUTPUT_WORD( pxPort->usIntReg, usInWord );
|
||||
|
||||
portOUTPUT_WORD( pxPort->usBaudReg, ( unsigned portSHORT ) ulBaudDiv );
|
||||
portOUTPUT_WORD( pxPort->usBaudReg, ( unsigned short ) ulBaudDiv );
|
||||
portOUTPUT_WORD( pxPort->usCtrlReg, serENABLE_INTERRUPTS | serMODE | serENABLE_TX_MACHINES | serENABLE_RX_MACHINES );
|
||||
|
||||
portOUTPUT_WORD( pxPort->usStatusReg, serCLEAR_ALL_STATUS_BITS );
|
||||
|
@ -324,12 +325,12 @@ unsigned portLONG ulBaudDiv;
|
|||
} /*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++ )
|
||||
{
|
||||
|
@ -341,7 +342,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 */
|
||||
|
@ -356,7 +357,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 )
|
||||
{
|
||||
|
@ -381,7 +382,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. */
|
||||
|
@ -405,8 +406,8 @@ unsigned portSHORT usOutput;
|
|||
unsigned short usStatus;
|
||||
static portBASE_TYPE xComPortISR( xComPort * const pxPort )
|
||||
{
|
||||
unsigned portSHORT usStatusRegister;
|
||||
portCHAR cChar;
|
||||
unsigned short usStatusRegister;
|
||||
char cChar;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
/* NOTE: THIS IS NOT AN EFFICIENT ISR AS IT IS DESIGNED SOLELY TO TEST
|
||||
|
@ -417,7 +418,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
|
||||
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. */
|
||||
|
@ -427,7 +428,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
{
|
||||
if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
|
||||
{
|
||||
portOUTPUT_WORD( pxPort->usTxReg, ( unsigned portSHORT ) cChar );
|
||||
portOUTPUT_WORD( pxPort->usTxReg, ( unsigned short ) cChar );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue