FluxDC/components/FluxProtocol/FluxProtocol.c

107 lines
3.1 KiB
C
Raw Normal View History

/**
* @file FluxProtocol.c
* @brief
*
* 便
*
* @author wang xiang en
* @date 2025-04-18
* @version
* @copyright (C)2025, YUWELL MEDTECH Co.ltd
*/
#include <stdio.h>
#include "FluxProtocol.h"
2025-04-23 08:58:26 +08:00
#include "esp_log.h"
/*记录spirits3的没分钟输出的体积*/
float Spirit3_Volume[4] = { 210,420,630,750};
float Spirit6_Volume[6] = { 210,420,630,840,1050,1200};
float YULite8_Volume[6] = { 210,420,630,840,1050,1200};
2025-04-23 09:36:19 +08:00
/* 应用 event_homePage 中的测试状态显示变量 */
extern bool is_bs_test_ing;
2025-04-23 08:58:26 +08:00
/*
* @brief
* 1. Time setting sent successfully
* 2. start testing
* 3. Waiting for the end of the test
* 4. The current frequency test has ended
* 5. All frequency tests have been completed, please record.
* 6. Device started successfully, please start testing.
*/
char *test_info[] = {"Time setting sent successfully!!",\
"start testing....",\
"Waiting for the end of the test...",\
"The current frequency test has ended!!",\
"All frequency tests have been completed!!",\
"Device started successfully!!!!"
};
/* 导出协议数据结构体 */
struct FluxProtocol fluxProtocol;
2025-04-23 08:58:26 +08:00
/**
* @brief BS测试的任务函数
*
* @param[in] arg not used
*
*/
void bs_test_task(void* arg)
{
while(1)
{
vTaskDelay(1000 / portTICK_PERIOD_MS);
ESP_LOGI("bs_test_task", "bs_test_task");
vTaskDelay(4000 / portTICK_PERIOD_MS);
ESP_LOGI("bs_test_task", "bs_test_task end?");
ESP_LOGI("bs_test_timer_func","hahahahhahah............");
/* 显示测试成功 */
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[3]);
vTaskDelay(4000/portTICK_PERIOD_MS);
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[4]);
vTaskDelay(4000/portTICK_PERIOD_MS);
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[5]);
vTaskDelay(4000/portTICK_PERIOD_MS);
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[1]);
vTaskDelay(4000/portTICK_PERIOD_MS);
lv_label_set_text(ui_pageHome_labelBSInfo,test_info[2]);
ESP_LOGI("bs_test_timer_func","bs_test_timer_func end right");
2025-04-23 09:36:19 +08:00
/* 任务测试完毕 删除任务 */
lv_label_set_text(ui_pageHome_labelStartTest1,"Start Test BS");
is_bs_test_ing = false;
2025-04-23 08:58:26 +08:00
vTaskDelete(NULL);
}
}
2025-04-23 09:36:19 +08:00
/**
* @brief 线
*
* LED小灯bling bling
*
* @param[in] arg not used
*
*/
void bs_test_led_task(void* arg)
{
while(1)
{
vTaskDelay(1000 / portTICK_PERIOD_MS);
ESP_LOGI("bs_test_led_task", "bs_test_led_task");
vTaskDelay(1000 / portTICK_PERIOD_MS);
ESP_LOGI("bs_test_led_task", "bs_test_led_task end?");
}
}