Skip to content

Commit b8b7c68

Browse files
authored
Merge pull request #682 from FrameworkComputer/lotus.fix_wrong_prochot_behavior
De-assert the EC prochot when adapter is disconnected
2 parents 8b143c2 + de6faea commit b8b7c68

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

zephyr/program/lotus/lotus/src/charger.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,18 @@ void board_check_current(void)
253253
static int curr_status = EC_DEASSERTED_PROCHOT;
254254
static int pre_status = EC_DEASSERTED_PROCHOT;
255255
static int active_port;
256+
static int pre_active_port;
256257
static int shunt_register;
257258

258259
active_port = charge_manager_get_active_charge_port();
259260

260261
if (active_port == CHARGE_PORT_NONE) {
261-
curr_status = EC_DEASSERTED_PROCHOT;
262+
if (pre_active_port != active_port) {
263+
curr_status = EC_DEASSERTED_PROCHOT;
264+
throttle_ap(THROTTLE_OFF, THROTTLE_HARD, THROTTLE_SRC_AC);
265+
266+
pre_active_port = active_port;
267+
}
262268
hook_call_deferred(&board_check_current_data, 100 * MSEC);
263269
return;
264270
}
@@ -291,6 +297,7 @@ void board_check_current(void)
291297
}
292298

293299
pre_status = curr_status;
300+
pre_active_port = active_port;
294301
}
295302

296303
/* EC console command */

0 commit comments

Comments
 (0)