Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning and offset voltage corruption after fw update or downgrade (#466 fix) #458

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,13 @@ void settings_load(void) {
settings_load_osd_element(&g_setting.osd.element[OSD_GOGGLE_TEMP_RIGHT], "goggle_temp_right", &g_setting_defaults.osd.element[OSD_GOGGLE_TEMP_RIGHT]);

// power
g_setting.power.voltage = ini_getl("power", "voltage", g_setting_defaults.power.voltage, SETTING_INI);
g_setting.power.voltage = ini_getl("power", "voltage_mv", g_setting_defaults.power.voltage, SETTING_INI);
g_setting.power.warning_type = ini_getl("power", "warning_type", g_setting_defaults.power.warning_type, SETTING_INI);
g_setting.power.cell_count_mode = ini_getl("power", "cell_count_mode", g_setting_defaults.power.cell_count_mode, SETTING_INI);
g_setting.power.cell_count = ini_getl("power", "cell_count", g_setting_defaults.power.cell_count, SETTING_INI);
g_setting.power.osd_display_mode = ini_getl("power", "osd_display_mode", g_setting_defaults.power.osd_display_mode, SETTING_INI);
g_setting.power.power_ana = ini_getl("power", "power_ana_rx", g_setting_defaults.power.power_ana, SETTING_INI);
g_setting.power.calibration_offset = ini_getl("power", "calibration_offset", g_setting_defaults.power.calibration_offset, SETTING_INI);
g_setting.power.calibration_offset = ini_getl("power", "calibration_offset_mv", g_setting_defaults.power.calibration_offset, SETTING_INI);

// record
g_setting.record.mode_manual = settings_get_bool("record", "mode_manual", g_setting_defaults.record.mode_manual);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/page_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void page_power_update_cell_count() {

static void page_power_update_calibration_offset() {
g_battery.offset = g_setting.power.calibration_offset;
ini_putl("power", "calibration_offset", g_battery.offset, SETTING_INI);
ini_putl("power", "calibration_offset_mv", g_battery.offset, SETTING_INI);

lv_slider_set_value(slider_group_calibration_offset.slider, g_battery.offset, LV_ANIM_OFF);
char buf[7];
Expand Down Expand Up @@ -203,7 +203,7 @@ static void power_warning_voltage_inc(void) {

g_setting.power.voltage = value;
LOGI("vol:%d", g_setting.power.voltage);
ini_putl("power", "voltage", g_setting.power.voltage, SETTING_INI);
ini_putl("power", "voltage_mv", g_setting.power.voltage, SETTING_INI);
}

static void power_warning_voltage_dec(void) {
Expand All @@ -220,7 +220,7 @@ static void power_warning_voltage_dec(void) {

g_setting.power.voltage = value;
LOGI("vol:%d", g_setting.power.voltage);
ini_putl("power", "voltage", g_setting.power.voltage, SETTING_INI);
ini_putl("power", "voltage_mv", g_setting.power.voltage, SETTING_INI);
}

static void power_calibration_offset_inc(void) {
Expand Down