From a5c1831ade1f02d405edd23e980d42227dc5c903 Mon Sep 17 00:00:00 2001 From: SiteRelEnby <125829806+SiteRelEnby@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:33:42 -0500 Subject: [PATCH] bugfix: remove dependency on voltage correction for post-off voltage --- ui/anduril/battcheck-mode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/anduril/battcheck-mode.c b/ui/anduril/battcheck-mode.c index c7c80dd1..12b15f82 100644 --- a/ui/anduril/battcheck-mode.c +++ b/ui/anduril/battcheck-mode.c @@ -78,5 +78,16 @@ uint8_t voltage_config_state(Event event, uint16_t arg) { VOLTAGE_CONFIG_STEPS, voltage_config_save); } +#else // #ifdef USE_VOLTAGE_CORRECTION +#ifdef USE_POST_OFF_VOLTAGE +void voltage_config_save(uint8_t step, uint8_t value) { + if (value) cfg.post_off_voltage = value; +} +uint8_t voltage_config_state(Event event, uint16_t arg) { + #define VOLTAGE_CONFIG_STEPS 1 + return config_state_base(event, arg, + VOLTAGE_CONFIG_STEPS, + voltage_config_save); +} +#endif // #ifdef USE_POST_OFF_VOLTAGE #endif // #ifdef USE_VOLTAGE_CORRECTION -