feat(radio): allow disabling USB charge while the radio is running (on compatible hardware) (#7564)

Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
3djc
2026-08-21 20:16:55 +10:00
committed by GitHub
co-authored by 3djc Claude Opus 5 Peter Feerick Peter Feerick
parent 2baf75f3aa
commit a51946c4e2
38 changed files with 134 additions and 15 deletions
@@ -966,6 +966,23 @@ const static SetupLineDef setupLines[] = {
GET_SET_DEFAULT(g_eeGeneral.USBMode));
}
},
#if defined(USB_CHARGE_CONTROL)
{
// Charge while radio on
STR_DEF(STR_USB_CHARGE),
[](Window* parent, coord_t x, coord_t y) {
new ToggleSwitch(parent, {x, y, 0, 0},
GET_INVERTED(g_eeGeneral.usbChargeDisabled),
[](uint8_t newValue) {
g_eeGeneral.usbChargeDisabled = !newValue;
SET_DIRTY();
// take effect now, not only on the next plug
if (usbPlugged())
usbChargerEnableCharge(!g_eeGeneral.usbChargeDisabled);
});
}
},
#endif
#if defined(ROTARY_ENCODER_NAVIGATION) && !defined(USE_HATS_AS_KEYS)
{
STR_DEF(STR_ROTARY_ENC_MODE),