增加 BLE MAC 地址管理功能,添加电量灯颜色设置,优化调度器挂起和恢复逻辑
This commit is contained in:
@@ -526,6 +526,25 @@ int app_cfg_set_mac_tab(uint8_t mac[6])
|
||||
return 0;
|
||||
}
|
||||
|
||||
int app_cfg_set_ble_mac_tab(uint8_t mac[6])
|
||||
{
|
||||
for (int i = 0; i < __ARRAY_SIZE(s_cfg_app.ble_mac_tab); i++)
|
||||
{
|
||||
if (memcmp(mac, s_cfg_app.ble_mac_tab[i], 6) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (++s_cfg_app.ble_mac_index >= __ARRAY_SIZE(s_cfg_app.ble_mac_tab))
|
||||
{
|
||||
s_cfg_app.ble_mac_index = 0;
|
||||
}
|
||||
memcpy(s_cfg_app.ble_mac_tab[s_cfg_app.ble_mac_index], mac, sizeof(s_cfg_app.ble_mac_tab[0]));
|
||||
app_cfg_do_save(1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int app_cfg_set_temp_log_on(bool sw)
|
||||
{
|
||||
// SYS_LOG_INF("set temp log on: %d", sw);
|
||||
@@ -552,3 +571,15 @@ int app_cfg_set_gyro_heat_value(uint8_t value)
|
||||
app_cfg_do_save(100);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int app_cfg_set_bat_led_color(uint32_t color)
|
||||
{
|
||||
if (color > 0xFFFFFF)
|
||||
{
|
||||
SYS_LOG_WRN("error color: %d", color);
|
||||
return -1;
|
||||
}
|
||||
s_cfg_app.ws2812_bat_led_color = color & 0xFFFFFF;
|
||||
app_cfg_do_save(100);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user