增加 BLE MAC 地址管理功能,添加电量灯颜色设置,优化调度器挂起和恢复逻辑

This commit is contained in:
LokLiang
2025-06-23 12:02:30 +08:00
parent 176b2c49f6
commit f34eaca585
13 changed files with 259 additions and 20 deletions

View File

@@ -104,7 +104,7 @@ typedef struct // 设备配置统一数据结构
bool strip_pwrup : 1; // 使用灯带上电效果
bool strip_show_rf : 1; // 在灯带中用一个灯来显示射频数据接口状态的灯效图层
bool strip_link_fc : 1; // 开启灯带联动飞控用于飞控状态监控MSP
char ws2812_bat_led_mode : 2; // 电量灯效, 0: 关闭, 1: 普通飞控, 2: 竞速飞控
char ws2812_bat_led_mode : 3; // 电量灯效, 0: 关闭, 1: 普通飞控, 2: 竞速飞控, 3: 固定翼飞控
uint32_t reserve : 21; // 预留占位(原来是24个uint32)
} capacity;
@@ -132,8 +132,12 @@ typedef struct // 设备配置统一数据结构
} temperature_log;
bool ws2812_bat_led_direction; // 0: 正向1: 反向(正反向是指灯珠的连接方式,正向是指从第一个灯珠开始,反向是指从最后一个灯珠开始)
uint32_t ws2812_bat_led_color; // 电量灯颜色, RGB颜色值,如 0xFFFFFF 代表白色(默认)
uint32_t reserve[36]; // 预留占位,下次更改时保证参数总长度不变,如超过预留长度后则当作新数据处理,sizeof(cfg_app_t) = 484UL
uint8_t ble_mac_index; // 记录当前通过 BLE 连接过的 APP 的 MAC 地址的序号
uint8_t ble_mac_tab[6][6]; // 记录当前通过 BLE 连接过的 APP 的 MAC 地址, 6 个 MAC 地址,每个 MAC 地址 6 字节,判断是否 APP 设备连接,用于决定是否停止对飞控状态监测
uint32_t reserve[25]; // 预留占位,下次更改时保证参数总长度不变,如超过预留长度后则当作新数据处理,sizeof(cfg_app_t) = 484UL
uint32_t crc32; // 校验数据(可放于任何位置)
} cfg_app_t;
@@ -182,8 +186,11 @@ int app_cfg_set_wifi_sta_ssid(const void *ssid);
int app_cfg_set_wifi_sta_password(const void *password);
int app_cfg_set_mac_tab(uint8_t mac[6]);
int app_cfg_set_ble_mac_tab(uint8_t mac[6]);
int app_cfg_set_temp_log_on(bool sw);
int app_cfg_set_temp_log_index(uint8_t index);
int app_cfg_set_gyro_heat_value(uint8_t value);
int app_cfg_set_bat_led_color(uint32_t color);