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:
Richard Barry 2013-02-07 15:10:25 +00:00
parent b5b518571e
commit 4e5090e061
12 changed files with 997 additions and 386 deletions

View file

@ -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.

View file

@ -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" />

View file

@ -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">

View file

@ -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. */