From 46921aca22fe97b0ea09f4e9739824017a5b7665 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Mon, 4 Jan 2021 02:58:07 +0200 Subject: [PATCH] Disable battery management on dev units --- bootloader/main.c | 3 +++ nyx/nyx_gui/frontend/gui.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bootloader/main.c b/bootloader/main.c index 37ae76d..5edb93e 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -1245,6 +1245,9 @@ static void _show_errors() static void _check_low_battery() { + if (fuse_read_hw_state() == FUSE_NX_HW_STATE_DEV) + goto out; + int enough_battery; int batt_volt = 0; int charge_status = 0; diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 069974f..84ba4ff 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -718,11 +718,14 @@ lv_res_t mbox_action(lv_obj_t *btns, const char *txt) bool nyx_emmc_check_battery_enough() { - int batt_volt = 4000; + if (fuse_read_hw_state() == FUSE_NX_HW_STATE_DEV) + return true; + + int batt_volt = 0; max17050_get_property(MAX17050_VCELL, &batt_volt); - if (batt_volt < 3650) + if (batt_volt && batt_volt < 3650) { lv_obj_t *dark_bg = lv_obj_create(lv_scr_act(), NULL); lv_obj_set_style(dark_bg, &mbox_darken);