~aleteoryx/muditaos

659d72027449eda18f654136959e9b3d9fb6c766 — Maciej Gibowicz 4 years ago 2ac0190
[EGD-7939] Fix wrong battery status after restarting the phone

Adding the necessary, short delay for synchronization
after configuration.
1 files changed, 3 insertions(+), 0 deletions(-)

M module-bsp/board/rt1051/puretx/bsp/battery_charger/battery_charger.cpp
M module-bsp/board/rt1051/puretx/bsp/battery_charger/battery_charger.cpp => module-bsp/board/rt1051/puretx/bsp/battery_charger/battery_charger.cpp +3 -0
@@ 573,6 573,9 @@ namespace bsp::battery_charger
        configureTemperatureMeasurement();

        checkTemperatureRange();

        // Short time to synchronize after configuration
        vTaskDelay(pdMS_TO_TICKS(100));
        StateOfCharge level = getBatteryLevel();
        bool charging       = getChargeStatus();
        LOG_INFO("Phone battery start state: %d %d", level, charging);