reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

commit 25c9b3f4e2816c3fc888addedeea593a3e556e60
parent b1c6144dbacd9a69a15166740097107c62747482
Author: mntmn <lukas@mntmn.com>
Date:   Fri,  6 Nov 2020 09:15:25 +0100

lpc-fw: emergency turnoff only if there's no wall power

Diffstat:
Mreform2-lpc-fw/src/boards/reform2/board_reform2.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/reform2-lpc-fw/src/boards/reform2/board_reform2.c b/reform2-lpc-fw/src/boards/reform2/board_reform2.c @@ -801,8 +801,8 @@ int main(void) if (cycles_in_state > 1) { // TODO: find safe heuristic. here we turn off if half - // of the cells are undervolted. - if (num_undervolted_critical_cells >= 1 || num_undervolted_cells >= 4) { + // of the cells are undervolted and there's no wall power. + if (volts < 26 && (num_undervolted_critical_cells >= 1 || num_undervolted_cells >= 4)) { turn_som_power_off(); } @@ -836,7 +836,7 @@ int main(void) if (num_missing_cells < 1) { state = ST_CHARGE; cycles_in_state = 0; - } else { + } else if (volts < 26) { turn_som_power_off(); } }