Disable battery management on dev units

This commit is contained in:
CTCaer 2021-01-04 02:58:07 +02:00
parent 41f96d4305
commit 46921aca22
2 changed files with 8 additions and 2 deletions

View file

@ -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;

View file

@ -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);