feat(core/bootloader): stop charging indication when the battery is fully charged
What changed, and why it matters
This commit changes the bootloader's battery-charging LED behavior. When the battery is fully charged, the charging LED effect now turns off instead of continuing to show a charging animation. It also adds a small helper function for the Unix emulator build so it can compile. There is no security issue visible in this change.
No security action required. Treat as normal feature/UI commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The bootloader’s boot_sequence() previously checked state.charging_status == PM_BATTERY_CHARGING to decide whether to start the RGB LED charging effect. It now uses pm_is_charging(), and when that returns false it explicitly calls rgb_led_set_color(0) to turn the LED off. A stub implementation of pm_is_charging() returning false is added for the Unix power-manager target. The change is purely UI/UX around charging indication and hibernation logic.
Changed components
core/embed/projects/bootloader/main.ccore/embed/sys/power_manager/unix/power_manager.cInspect captured patch +7 / −4
diff --git a/core/embed/projects/bootloader/main.c b/core/embed/projects/bootloader/main.c
index 4d728954..e258027e 100644
--- a/core/embed/projects/bootloader/main.c
+++ b/core/embed/projects/bootloader/main.c
@@ -236,21 +236,22 @@ static secbool boot_sequence(void) {
pm_state_t state;
pm_get_state(&state);
- if (state.charging_status == PM_BATTERY_CHARGING) {
- // charing screen
+ if (pm_is_charging()) {
+ // charging indication
#ifdef USE_RGB_LED
if (!rgb_led_effect_ongoing()) {
rgb_led_effect_start(RGB_LED_EFFECT_CHARGING, 0);
}
#endif
} else {
+#ifdef USE_RGB_LED
+ rgb_led_set_color(0);
+#endif
if (!btn_down && !state.usb_connected && !state.wireless_connected) {
// device in just intended to be turned off
pm_hibernate();
systick_delay_ms(1000);
reboot_to_off();
- } else {
- // todo signal full battery if conditions are met
}
}
}
diff --git a/core/embed/sys/power_manager/unix/power_manager.c b/core/embed/sys/power_manager/unix/power_manager.c
index 0204fb8c..e9c61203 100644
--- a/core/embed/sys/power_manager/unix/power_manager.c
+++ b/core/embed/sys/power_manager/unix/power_manager.c
@@ -72,4 +72,6 @@ pm_status_t pm_get_state(pm_state_t* state) {
return PM_OK;
}
+bool pm_is_charging(void) { return false; }
+
pm_status_t pm_set_soc_target(uint8_t target) { return PM_OK; }
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.