Fix T-Deck battery estimate

This commit is contained in:
Trail Mate Dev
2026-05-30 16:46:24 +08:00
parent ff98125e91
commit fad0ca9bb2
13 changed files with 417 additions and 103 deletions
@@ -1582,6 +1582,7 @@ static void on_text_save_clicked(lv_event_t* e)
return;
}
prefs_put_uint_ns("power", "gauge_design_mah", static_cast<uint32_t>(value));
device_runtime::reload_configurable_battery_gauge();
}
if (g_state.editing_item->pref_key && strcmp(g_state.editing_item->pref_key, "gauge_full_mah") == 0)
{
@@ -1595,6 +1596,7 @@ static void on_text_save_clicked(lv_event_t* e)
return;
}
prefs_put_uint_ns("power", "gauge_full_mah", static_cast<uint32_t>(value));
device_runtime::reload_configurable_battery_gauge();
}
if (g_state.editing_item->pref_key &&
(strcmp(g_state.editing_item->pref_key, "wifi_ssid") == 0 ||
@@ -3268,6 +3270,11 @@ static bool should_show_item(const settings::ui::SettingItem& item)
{
return false;
}
if ((has_pref_key(item, "gauge_design_mah") || has_pref_key(item, "gauge_full_mah")) &&
!device_runtime::supports_configurable_battery_gauge())
{
return false;
}
if (meshcore)
{
if (has_pref_key(item, "chat_region")) return false;