static void vEcho( void *pvParameters )
{
while(1) {
printf("task vecho %s says hello to you!\n", (char *) pvParameters);
Sleep( rand()%500 ); //这个可以修改为vTaskDelay( rand()%500 )
}
}
int main()
{
/* Setup the microcontroller hardware for the demo. */
//prvSetupHardware();
vPrintInitialise();
/* Create the common demo application tasks, for example: */
vStartBlockingQueueTasks(mainQUEUE_BLOCK_PRIORITY);
vCreateBlockTimeTasks();
vStartSemaphoreTasks(mainSEMAPHORE_TASK_PRIORITY);
/* Create the "Print" task as described at the top of the file. */
xTaskCreate( vErrorChecks, "ErrorChk", 100, NULL, 0, NULL );
xTaskCreate( vEcho, "hehe, 1", 200, "My name is hehe 1", 0, NULL );
xTaskCreate( vEcho, "hehe, 2", 200, "My name is hehe 2", 0, NULL );
|