mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Main Menu: Fix MNTM style battery percent off by 1 (#339)
* Battery: MNTM menu style battery off by 1 - Uses the same `furi_hal_power_get_pct` function used on the desktop to fix the apparent rounded error that's happening and show the same battery %. * Update changelog --------- Co-authored-by: Willy-JL <49810075+Willy-JL@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
### Fixed:
|
||||
- Desktop: Fixed Wardriving animation design (by @Davim09)
|
||||
- Main Menu: Fix MNTM style battery percent off by 1 (#339 by @956MB)
|
||||
- OFW: Fix lost BadBLE keystrokes (by @Astrrra)
|
||||
- OFW: GPIO: Fix USB UART Bridge Crash by increasing system stack size (by @Astrrra)
|
||||
- OFW: Loader: Fix BusFault in handling of OOM (by @Willy-JL)
|
||||
|
||||
@@ -391,10 +391,8 @@ static void menu_draw_callback(Canvas* canvas, void* _model) {
|
||||
snprintf(clk, sizeof(clk), "%02u:%02u", hour, min);
|
||||
canvas_draw_str(canvas, 5, 34, clk);
|
||||
|
||||
uint32_t battery_capacity = furi_hal_power_get_battery_full_capacity();
|
||||
uint32_t battery_remaining = furi_hal_power_get_battery_remaining_capacity();
|
||||
bool ext5v = furi_hal_power_is_otg_enabled();
|
||||
uint16_t battery_percent = (battery_remaining * 100) / battery_capacity;
|
||||
uint8_t battery_percent = furi_hal_power_get_pct();
|
||||
bool charge_state = false;
|
||||
|
||||
// Determine charge state
|
||||
|
||||
Reference in New Issue
Block a user