TA的每日心情 | 开心 2020-2-14 12:16 |
---|
签到天数: 827 天 连续签到: 1 天 [LV.10]以坛为家III
|
楼主 |
发表于 2016-6-11 23:21:35
|
显示全部楼层
相关函数说明- vTaskStartScheduler();
- /*vTaskEndScheduler () requires an exit function to be defined within the
- * portable layer (see vPortEndScheduler () in port. c for the PC port). This
- * performs hardware specific operations such as stopping the kernel tick.
- * vTaskEndScheduler () will cause all of the resources allocated by the
- * kernel to be freed - but will not free resources allocated by application
- tasks.*/
复制代码- /**
- * \brief Initialize tasks and resources for demo
- *
- * This function initializes the \ref oled1_xpro_io_group instance and the
- * \ref edbg_cdc_rx_group instance for reception, then creates all
- * the objects for FreeRTOS to run the demo.
- */
- void demotasks_init(void)
- {
- // Initialize hardware for the OLED1 Xplained Pro driver instance
- oled1_init(&oled1);
- // Configure SERCOM USART for reception from EDBG Virtual COM Port
- cdc_rx_init(&cdc_usart, &cdc_rx_handler);
- display_mutex = xSemaphoreCreateMutex();
- terminal_mutex = xSemaphoreCreateMutex();
- terminal_in_queue = xQueueCreate(64, sizeof(uint8_t));
- xTaskCreate(about_task,
- (const char *)"About",
- configMINIMAL_STACK_SIZE,
- NULL,
- ABOUT_TASK_PRIORITY,
- &about_task_handle);
- xTaskCreate(graph_task,
- (const char *)"Graph",
- configMINIMAL_STACK_SIZE,
- NULL,
- GRAPH_TASK_PRIORITY,
- NULL);
- xTaskCreate(main_task,
- (const char *) "Main",
- configMINIMAL_STACK_SIZE,
- NULL,
- MAIN_TASK_PRIORITY,
- NULL);
- xTaskCreate(terminal_task,
- (const char *)"Term.",
- configMINIMAL_STACK_SIZE,
- NULL,
- TERMINAL_TASK_PRIORITY,
- &terminal_task_handle);
- xTaskCreate(uart_task,
- (const char *) "UART",
- configMINIMAL_STACK_SIZE,
- NULL,
- UART_TASK_PRIORITY,
- NULL);
- // Suspend these since the main task will control their execution
- vTaskSuspend(about_task_handle);
- vTaskSuspend(terminal_task_handle);
- }
复制代码 |
|