/* Standard includes. */ #include /* Kernel includes. */ #include #include "task.h" #include "queue.h" /* Standard demo includes. */ #include "BlockQ.h" #include "integer.h" #include "semtest.h" #include "PollQ.h" #include "GenQTest.h" #include "QPeek.h" #include "recmutex.h" #include "flop.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 ) /* Task function prototypes. */ static void prvCheckTask( void *pvParameters ); static void vTask1( void *pvParameters ); static void vTask2( void *pvParameters ); static void vTask3( void *pvParameters ); static void vTask4( void *pvParameters ); xTaskHandle xTask1Handle,xTask2Handle; int main( void ) { printf( "%s : %s\n","main", "xTaskCreate(vTask1,Task1,configMINIMAL_STACK_SIZE,NULL,1,&xTask1Handle)"); xTaskCreate(vTask1,"Task1",configMINIMAL_STACK_SIZE,NULL,1,&xTask1Handle); printf( "%s : %s\n","main", "xTaskCreate(vTask2,Task2,configMINIMAL_STACK_SIZE,NULL,1,&xTask2Handle)"); xTaskCreate(vTask2,"Task2",configMINIMAL_STACK_SIZE,NULL,1,&xTask2Handle); printf( "%s : %s\n","main", "vTaskStartScheduler"); vTaskStartScheduler(); /* Should never get here unless there was not enough heap space to create the idle and other system tasks. */ return 0; } /*-----------------------------------------------------------*/ static void vTask1( void *pvParameters )//priority 4 { /* Just to remove compiler warning. */ ( void ) pvParameters; printf( "%s : %s\n","Task1", "vTaskDelete(xTask1Handle)"); vTaskDelete(xTask1Handle); } /*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/ static void vTask2( void *pvParameters ) { /* Just to remove compiler warning. */ ( void ) pvParameters; printf( "%s : %s\n","Task2", "vTaskDelete(xTask2Handle)"); vTaskDelete(xTask2Handle); } /*-----------------------------------------------------------*/ void vApplicationIdleHook( void ) { const unsigned long ulMSToSleep = 5; /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are tasks waiting to be terminated by the idle task. */ Sleep( ulMSToSleep ); } /*-----------------------------------------------------------*/ void vApplicationMallocFailedHook( void ) { /* Can be implemented if required, but probably not required in this environment and running this demo. */ } /*-----------------------------------------------------------*/ void vApplicationStackOverflowHook( void ) { /* Can be implemented if required, but not required in this environment and running this demo. */ }