#include "flash.h"\r
#include "integer.h"\r
#include "comtest2.h"\r
-#include "PollQ.h"\r
#include "semtest.h"\r
#include "BlockQ.h"\r
#include "dynamic.h"\r
#include "death.h"\r
#include "taskutility.h"\r
#include "partest.h"\r
+#include "crflash.h"\r
\r
/* Demo task priorities. */\r
#define mainWATCHDOG_TASK_PRIORITY ( tskIDLE_PRIORITY + 5 )\r
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )\r
-#define mainUTILITY_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
+#define mainUTILITY_TASK_PRIORITY ( tskIDLE_PRIORITY )\r
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 3 )\r
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
-#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 2 )\r
#define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )\r
/* The number of interrupt levels to use. */\r
#define mainINTERRUPT_LEVELS ( 31 )\r
\r
+/* The number of 'flash' co-routines to create - each toggles a different LED. */\r
+#define mainNUM_FLASH_CO_ROUTINES ( 8 )\r
+\r
/*---------------------------------------------------------------------------*/\r
\r
/* \r
register test tasks. */\r
unsigned portLONG ulRegTestError = pdFALSE;\r
\r
-/* Variables used to ensure the register check tasks are still executing. */\r
-static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;\r
-\r
/*---------------------------------------------------------------------------*/\r
\r
/* Start all the demo application tasks, then start the scheduler. */\r
vStartLEDFlashTasks( mainLED_TASK_PRIORITY ); \r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED - 1 );\r
- vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY ); \r
vStartDynamicPriorityTasks(); \r
vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
vStartQueuePeekTasks();\r
vCreateBlockTimeTasks();\r
+ vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );\r
\r
/* Start the 'Check' task which is defined in this file. */\r
xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); \r
static portSHORT prvCheckOtherTasksAreStillRunning( void )\r
{\r
portBASE_TYPE lReturn = pdPASS;\r
-static unsigned portLONG ulLastRegTest1Counter = 0UL, ulLastRegTest2Counter = 0UL;\r
\r
/* The demo tasks maintain a count that increments every cycle of the task\r
provided that the task has never encountered an error. This function \r
lReturn = pdFAIL;\r
}\r
\r
- if( xArePollingQueuesStillRunning() != pdTRUE )\r
- {\r
- lReturn = pdFAIL;\r
- }\r
-\r
if( xAreComTestTasksStillRunning() != pdTRUE )\r
{\r
lReturn = pdFAIL;\r
lReturn = pdFAIL;\r
}\r
\r
- /* Are the register test tasks still running? */\r
- if( ulLastRegTest1Counter == ulRegTest1Counter )\r
- {\r
- lReturn = pdFAIL;\r
- }\r
- \r
- if( ulLastRegTest2Counter == ulRegTest2Counter )\r
- {\r
- lReturn = pdFAIL;\r
- }\r
-\r
- /* Record the current values of the register check cycle counters so we\r
- can ensure they are still running the next time this function is called. */\r
- ulLastRegTest1Counter = ulRegTest1Counter;\r
- ulLastRegTest2Counter = ulRegTest2Counter;\r
-\r
return lReturn;\r
}\r
/*-----------------------------------------------------------*/\r
#if WATCHDOG == WTC_IN_IDLE\r
Kick_Watchdog();\r
#endif\r
+\r
+ vCoRoutineSchedule();\r
}\r
#else\r
#if WATCHDOG == WTC_IN_IDLE\r
/* Fills the registers with known values (different to the values\r
used in vSecondRegisterTestTask()), then checks that the registers still\r
all contain the expected value. This is done to test the context save\r
- and restore mechanism as this task is swapped onto and off of the CPU.\r
-\r
- The critical nesting depth is also saved as part of the context so also\r
- check this maintains an expected value. */\r
- ulCriticalNesting = 0x12345678;\r
+ and restore mechanism as this task is swapped onto and off of the CPU. */\r
\r
for( ;; )\r
{\r
\r
\r
#pragma endasm\r
-\r
- ulRegTest1Counter++;\r
-\r
- if( ulCriticalNesting != 0x12345678 )\r
- {\r
- ulRegTestError = pdTRUE;\r
- }\r
}\r
}\r
/*-----------------------------------------------------------*/\r
/* Fills the registers with known values (different to the values\r
used in vFirstRegisterTestTask()), then checks that the registers still\r
all contain the expected value. This is done to test the context save\r
- and restore mechanism as this task is swapped onto and off of the CPU.\r
-\r
- The critical nesting depth is also saved as part of the context so also\r
- check this maintains an expected value. */\r
- ulCriticalNesting = 0x87654321;\r
+ and restore mechanism as this task is swapped onto and off of the CPU. */\r
\r
for( ;; )\r
{\r
\r
\r
#pragma endasm\r
-\r
- ulRegTest2Counter++;\r
-\r
- if( ulCriticalNesting != 0x87654321 )\r
- {\r
- ulRegTestError = pdTRUE;\r
- }\r
}\r
}\r
/*-----------------------------------------------------------*/\r