| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #include "App_freertosTask.h"
- #include <stdio.h>
- #define TASK_CPLD_PRIORITY 4
- #define TASK_CPLD_STACK_SIZE 512
- #define TASK_LVGL_PRIORITY 3
- #define TASK_LVGL_STACK_SIZE 1024
- #define TASK_TEST_PRIORITY 1
- #define TASK_TEST_STACK_SIZE 512
- TaskHandle_t xCPLDProcessTaskHandle = NULL;
- TaskHandle_t xLVGLDisplayTaskHandle = NULL;
- TaskHandle_t xTestTaskHandle = NULL;
- /**
- * @brief 创建各个任务
- *
- */
- void App_Task_Create(void)
- {
- BaseType_t ret;
- ret = xTaskCreate(Task_CPLD_Process, "cpldProcessTask", TASK_CPLD_STACK_SIZE, NULL, TASK_CPLD_PRIORITY, &xCPLDProcessTaskHandle);
- if (ret != pdPASS)
- {
- printf("[ERR] CPLD process task create failed\r\n");
- }
- ret = xTaskCreate(Task_LVGL_Display, "lvglDisplayTask", TASK_LVGL_STACK_SIZE, NULL, TASK_LVGL_PRIORITY, &xLVGLDisplayTaskHandle);
- if (ret != pdPASS)
- {
- printf("[ERR] LVGL display task create failed\r\n");
- }
- ret = xTaskCreate(Task_Test, "testTask", TASK_TEST_STACK_SIZE, NULL, TASK_TEST_PRIORITY, &xTestTaskHandle);
- if (ret != pdPASS)
- {
- printf("[ERR] Test task create failed\r\n");
- }
- }
- /**
- * @brief 处理 CPLD 通信的任务
- *
- * @param argument
- */
- void Task_CPLD_Process(void *argument)
- {
- (void)argument;
- printf("CPLD process task running...\r\n");
- while (1)
- {
- printf("CPLD\r\n");
- /* TODO: CPLD 通信处理 */
- vTaskDelay(pdMS_TO_TICKS(1000));
- }
- }
- /**
- * @brief 处理 LVGL 显示的任务
- *
- * @param argument
- */
- void Task_LVGL_Display(void *argument)
- {
- (void)argument;
- printf("LVGL display task running...\r\n");
- while (1)
- {
- printf("LVGL\r\n");
- /* TODO: LVGL 显示 */
- vTaskDelay(pdMS_TO_TICKS(3000));
- }
- }
- /**
- * @brief 处理测试的任务
- *
- * @param argument
- */
- void Task_Test(void *argument)
- {
- (void)argument;
- printf("Test task running...\r\n");
- while (1)
- {
- printf("TEST\r\n");
- /* TODO: 测试 */
- vTaskDelay(pdMS_TO_TICKS(5000));
- }
- }
|