mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Clear up a few compiler warnings.
Correct header comments in the UARTCommandConsole.c file used in the SmartFusion2 demo. Exercise the new xQueueSpacesAvailable() function in the MSVC demo. Add defaults for the new traceMALLOC and traceFREE trace macros. Catch tasks trying to exit their functions in the Cortex-M0 ports. Add additional comments to timers.c in response to a support forum question. Initialise _impure_ptr prior to the first task being started. Prior to V7.5.0 a yield pended in the tick hook would have occurred during the same tick interrupt. Return pdTRUE from xTaskIncrementTick() if a yield is pending to revert to that behaviour.
This commit is contained in:
parent
be44f8aaa7
commit
eaacbb099a
10 changed files with 241 additions and 63 deletions
|
@ -1,54 +1,65 @@
|
|||
/*
|
||||
FreeRTOS V7.1.0 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||
FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* FreeRTOS provides completely free yet professionally developed, *
|
||||
* robust, strictly quality controlled, supported, and cross *
|
||||
* platform software that has become a de facto standard. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* Help yourself get started quickly and support the FreeRTOS *
|
||||
* project by purchasing a FreeRTOS tutorial book, reference *
|
||||
* manual, or both from: http://www.FreeRTOS.org/Documentation *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* Thank you! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
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 modification 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. 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 and the FreeRTOS license exception along with FreeRTOS; if not it
|
||||
can be viewed here: http://www.freertos.org/a00114.html and also obtained
|
||||
by writing to Richard Barry, contact details for whom are available on the
|
||||
FreeRTOS WEB site.
|
||||
Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
|
||||
|
||||
>>! NOTE: The modification 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.
|
||||
|
||||
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. Full license text is available from the following
|
||||
link: http://www.freertos.org/a00114.html
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, latest information, license and
|
||||
contact details.
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong?" *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
http://www.SafeRTOS.com - A version that is certified for use in safety
|
||||
critical systems.
|
||||
http://www.FreeRTOS.org - Documentation, books, training, latest versions,
|
||||
license and Real Time Engineers Ltd. contact details.
|
||||
|
||||
http://www.OpenRTOS.com - Commercial support, development, porting,
|
||||
licensing and training services.
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
|
||||
compatible FAT file system, and our tiny thread aware UDP/IP stack.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
|
||||
Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
|
||||
licenses offer ticketed support, indemnification and middleware.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
*/
|
||||
|
||||
/* Standard includes. */
|
||||
|
|
|
@ -86,15 +86,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Changes from V4.1.1
|
||||
|
||||
+ The second set of tasks were created the wrong way around. This has been
|
||||
corrected.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Scheduler include files. */
|
||||
|
|
|
@ -387,6 +387,9 @@ static void prvQueueSetReceivingTask( void *pvParameters )
|
|||
unsigned long ulReceived;
|
||||
xQueueHandle xActivatedQueue;
|
||||
|
||||
/* Remove compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
||||
/* Create the queues and add them to the queue set before resuming the Tx
|
||||
task. */
|
||||
prvSetupTest();
|
||||
|
|
|
@ -161,6 +161,11 @@ static void prvTestTask( void *pvParameters );
|
|||
*/
|
||||
static void prvDemonstrateTaskStateAndHandleGetFunctions( void );
|
||||
|
||||
/*
|
||||
* A task to demonstrate the use of the xQueueSpacesAvailable() function.
|
||||
*/
|
||||
static void prvDemoQueueSpaceFunctions( void *pvParameters );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The variable into which error messages are latched. */
|
||||
|
@ -190,7 +195,8 @@ int main_full( void )
|
|||
vStartCountingSemaphoreTasks();
|
||||
vStartDynamicPriorityTasks();
|
||||
vStartQueueSetTasks();
|
||||
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
|
||||
vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );
|
||||
xTaskCreate( prvDemoQueueSpaceFunctions, ( signed char * ) "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
||||
|
||||
/* The suicide tasks must be created last as they need to know how many
|
||||
tasks were running prior to their creation. This then allows them to
|
||||
|
@ -453,4 +459,69 @@ xTaskHandle xTestTask;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvDemoQueueSpaceFunctions( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = NULL;
|
||||
const unsigned portBASE_TYPE uxQueueLength = 10;
|
||||
unsigned portBASE_TYPE uxReturn, x;
|
||||
|
||||
/* Remove compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
||||
/* Create the queue that will be used. Nothing is actually going to be
|
||||
sent or received so the queue item size is set to 0. */
|
||||
xQueue = xQueueCreate( uxQueueLength, 0 );
|
||||
configASSERT( xQueue );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
for( x = 0; x < uxQueueLength; x++ )
|
||||
{
|
||||
/* Ask how many messages are available... */
|
||||
uxReturn = uxQueueMessagesWaiting( xQueue );
|
||||
|
||||
/* Check the number of messages being reported as being available
|
||||
is as expected, and force an assert if not. */
|
||||
if( uxReturn != x )
|
||||
{
|
||||
/* xQueue cannot be NULL so this is deliberately causing an
|
||||
assert to be triggered as there is an error. */
|
||||
configASSERT( xQueue == NULL );
|
||||
}
|
||||
|
||||
/* Ask how many spaces remain in the queue... */
|
||||
uxReturn = uxQueueSpacesAvailable( xQueue );
|
||||
|
||||
/* Check the number of spaces being reported as being available
|
||||
is as expected, and force an assert if not. */
|
||||
if( uxReturn != ( uxQueueLength - x ) )
|
||||
{
|
||||
/* xQueue cannot be NULL so this is deliberately causing an
|
||||
assert to be triggered as there is an error. */
|
||||
configASSERT( xQueue == NULL );
|
||||
}
|
||||
|
||||
/* Fill one more space in the queue. */
|
||||
xQueueSendToBack( xQueue, NULL, 0 );
|
||||
}
|
||||
|
||||
/* Perform the same check while the queue is full. */
|
||||
uxReturn = uxQueueMessagesWaiting( xQueue );
|
||||
if( uxReturn != uxQueueLength )
|
||||
{
|
||||
configASSERT( xQueue == NULL );
|
||||
}
|
||||
|
||||
uxReturn = uxQueueSpacesAvailable( xQueue );
|
||||
|
||||
if( uxReturn != 0 )
|
||||
{
|
||||
configASSERT( xQueue == NULL );
|
||||
}
|
||||
|
||||
/* The queue is full, start again. */
|
||||
xQueueReset( xQueue );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue