mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-09-28 16:16:47 +08:00
Next revision of queue set implementation.
Make conditional compilation syntax and commenting consistent. Add common demo tasks to demonstrate queue sets.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -67,35 +67,12 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* This version of integer. c is for use on systems that have limited stack
|
||||
* space and no display facilities. The complete version can be found in
|
||||
* the Demo/Common/Full directory.
|
||||
*
|
||||
* As with the full version, the tasks created in this file are a good test
|
||||
* of the scheduler context switch mechanism. The processor has to access
|
||||
* 32bit variables in two or four chunks (depending on the processor). The low
|
||||
* priority of these tasks means there is a high probability that a context
|
||||
* switch will occur mid calculation. See flop. c documentation for
|
||||
* more information.
|
||||
*
|
||||
* Creates one or more tasks that repeatedly perform a set of integer
|
||||
* calculations. The result of each run-time calculation is compared to the
|
||||
* known expected result - with a mismatch being indicative of an error in the
|
||||
* context switch mechanism.
|
||||
*/
|
||||
|
||||
/*
|
||||
Changes from V1.2.1
|
||||
|
||||
+ The constants used in the calculations are larger to ensure the
|
||||
optimiser does not truncate them to 16 bits.
|
||||
|
||||
Changes from V1.2.3
|
||||
|
||||
+ uxTaskCheck is now just used as a boolean. Instead of incrementing
|
||||
the variable each cycle of the task, the variable is simply set to
|
||||
true. sAreIntegerMathsTaskStillRunning() sets it back to false and
|
||||
expects it to have been set back to true by the time it is called
|
||||
again.
|
||||
+ A division has been included in the calculation.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Scheduler include files. */
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
|
||||
|
||||
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE 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. *
|
||||
* *
|
||||
* 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! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
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.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* 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.FreeRTOS.org - Documentation, training, latest versions, license
|
||||
and contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool.
|
||||
|
||||
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
|
||||
the code with commercial support, indemnification, and middleware, under
|
||||
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
|
||||
provide a safety engineered and independently SIL3 certified version under
|
||||
the SafeRTOS brand: http://www.SafeRTOS.com.
|
||||
*/
|
||||
|
||||
#ifndef QUEUE_WAIT_MULTIPLE_H
|
||||
#define QUEUE_WAIT_MULTIPLE_H
|
||||
|
||||
void vStartQueueSetTasks( unsigned portBASE_TYPE uxPriority );
|
||||
portBASE_TYPE xAreQueueSetTasksStillRunning( void );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
#define configUSE_APPLICATION_TASK_TAG 0
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configUSE_ALTERNATIVE_API 1
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
|
||||
#define configUSE_TIMERS 1
|
||||
#define configTIMER_TASK_PRIORITY 2
|
||||
@@ -117,19 +118,19 @@
|
||||
/* Set the following definitions to 1 to include the API function, or zero
|
||||
to exclude the API function. */
|
||||
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_vTaskPrioritySet 1
|
||||
#define INCLUDE_uxTaskPriorityGet 1
|
||||
#define INCLUDE_vTaskDelete 1
|
||||
#define INCLUDE_vTaskCleanUpResources 0
|
||||
#define INCLUDE_vTaskSuspend 1
|
||||
#define INCLUDE_vTaskDelayUntil 1
|
||||
#define INCLUDE_vTaskDelay 1
|
||||
#define INCLUDE_uxTaskGetStackHighWaterMark 1
|
||||
#define INCLUDE_xTaskGetSchedulerState 1
|
||||
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 1
|
||||
#define INCLUDE_pcTaskGetTaskName 1
|
||||
#define INCLUDE_eTaskStateGet 1
|
||||
#define INCLUDE_xTaskGetIdleTaskHandle 1
|
||||
#define INCLUDE_pcTaskGetTaskName 1
|
||||
#define INCLUDE_eTaskGetState 1
|
||||
|
||||
extern void vAssertCalled( void );
|
||||
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()
|
||||
@@ -139,6 +140,5 @@ version of the Win32 simulator projects. It will be ignored in the GCC
|
||||
version. */
|
||||
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
|
||||
|
||||
#define configUSE_QUEUE_SETS 1
|
||||
|
||||
#endif /* FREERTOS_CONFIG_H */
|
||||
|
||||
Binary file not shown.
@@ -137,6 +137,7 @@
|
||||
<ClCompile Include="..\Common\Minimal\integer.c" />
|
||||
<ClCompile Include="..\Common\Minimal\PollQ.c" />
|
||||
<ClCompile Include="..\Common\Minimal\QPeek.c" />
|
||||
<ClCompile Include="..\Common\Minimal\QueueSet.c" />
|
||||
<ClCompile Include="..\Common\Minimal\semtest.c" />
|
||||
<ClCompile Include="..\Common\Minimal\timerdemo.c" />
|
||||
<ClCompile Include="DemosModifiedForLowTickRate\recmutex.c" />
|
||||
|
||||
@@ -94,6 +94,9 @@
|
||||
<ClCompile Include="..\Common\Minimal\dynamic.c">
|
||||
<Filter>Demo App Source\Common Demo Tasks</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Common\Minimal\QueueSet.c">
|
||||
<Filter>Demo App Source\Common Demo Tasks</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="FreeRTOSConfig.h">
|
||||
|
||||
@@ -117,18 +117,20 @@
|
||||
#include "countsem.h"
|
||||
#include "death.h"
|
||||
#include "dynamic.h"
|
||||
#include "QueueSet.h"
|
||||
|
||||
/* Priorities at which the tasks are created. */
|
||||
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
||||
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
||||
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
|
||||
#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
|
||||
#define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 )
|
||||
#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
#define mainQUEUE_SET_TASK_PRIORITY ( tskIDLE_PRIORITY )
|
||||
|
||||
#define mainTIMER_TEST_PERIOD ( 50 )
|
||||
|
||||
@@ -165,6 +167,7 @@ int main( void )
|
||||
vStartTimerDemoTask( mainTIMER_TEST_PERIOD );
|
||||
vStartCountingSemaphoreTasks();
|
||||
vStartDynamicPriorityTasks();
|
||||
vStartQueueSetTasks( mainQUEUE_SET_TASK_PRIORITY );
|
||||
|
||||
/* 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
|
||||
@@ -250,6 +253,10 @@ const portTickType xCycleFrequency = 1000 / portTICK_RATE_MS;
|
||||
{
|
||||
pcStatusMessage = "Error: Dynamic\r\n";
|
||||
}
|
||||
else if( xAreQueueSetTasksStillRunning() != pdPASS )
|
||||
{
|
||||
pcStatusMessage = "Error: Queue set\r\n";
|
||||
}
|
||||
|
||||
/* This is the only task that uses stdout so its ok to call printf()
|
||||
directly. */
|
||||
|
||||
@@ -560,7 +560,6 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
||||
|
||||
/* For backward compatability. */
|
||||
#define eTaskStateGet eTaskGetState
|
||||
#define INCLUDE_eTaskStateGet INCLUDE_eTaskGetState
|
||||
|
||||
#endif /* INC_FREERTOS_H */
|
||||
|
||||
|
||||
+138
-15
File diff suppressed because it is too large
Load Diff
+395
-204
File diff suppressed because it is too large
Load Diff
+73
-116
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user