From 7e1d8f28e13007a266a7a28ab98dd5184337a3a5 Mon Sep 17 00:00:00 2001 From: Veronika Kossmann Date: Sun, 20 Jul 2025 16:58:48 +0300 Subject: [PATCH] Return of battery reading Rollback 32bcd031588f7c3fb1a7eebd7536f524177b8b7f as AUX updated (#5) --- applications/services/desktop/animations/animation_manager.c | 5 ++--- targets/f7/furi_hal/furi_hal_power.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applications/services/desktop/animations/animation_manager.c b/applications/services/desktop/animations/animation_manager.c index c8ac1cf9f..858efb9fe 100644 --- a/applications/services/desktop/animations/animation_manager.c +++ b/applications/services/desktop/animations/animation_manager.c @@ -366,14 +366,13 @@ static bool animation_manager_is_valid_idle_animation( bool result = true; - /*if(!strcmp(info->name, BAD_BATTERY_ANIMATION_NAME)) { + if(!strcmp(info->name, BAD_BATTERY_ANIMATION_NAME)) { Power* power = furi_record_open(RECORD_POWER); bool battery_is_well = power_is_battery_healthy(power); furi_record_close(RECORD_POWER); result = !battery_is_well; - }*/ - + } if(!strcmp(info->name, NO_SD_ANIMATION_NAME)) { Storage* storage = furi_record_open(RECORD_STORAGE); FS_Error sd_status = storage_sd_status(storage); diff --git a/targets/f7/furi_hal/furi_hal_power.c b/targets/f7/furi_hal/furi_hal_power.c index e1321cdfc..fe5c0cf17 100644 --- a/targets/f7/furi_hal/furi_hal_power.c +++ b/targets/f7/furi_hal/furi_hal_power.c @@ -71,7 +71,7 @@ void furi_hal_power_init(void) { furi_hal_i2c_acquire(&furi_hal_i2c_handle_power); // Find and init gauge - size_t retry = 0; + size_t retry = 2; while(retry > 0) { furi_hal_power.gauge_ok = bq27220_init(&furi_hal_i2c_handle_power, furi_hal_power_gauge_data_memory); @@ -85,7 +85,7 @@ void furi_hal_power_init(void) { retry--; } // Find and init charger - retry = 0; + retry = 2; while(retry > 0) { furi_hal_power.charger_ok = bq25896_init(&furi_hal_i2c_handle_power); if(furi_hal_power.charger_ok) {