changeset 190:49c7ed5eeadd

FCHG: sync with Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 16 Apr 2020 17:29:54 +0000
parents d78986760e92
children 4725fe5932c4
files src/cs/drivers/drv_app/fchg/fchg_process.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/fchg/fchg_process.c	Tue Apr 14 20:26:40 2020 +0000
+++ b/src/cs/drivers/drv_app/fchg/fchg_process.c	Thu Apr 16 17:29:54 2020 +0000
@@ -69,7 +69,7 @@
 	 * of the I to V converter
 	 */
 	ABB_Write_Register_on_page(PAGE0, BCICTL2, 0x0010);
-	ABB_Write_Register_on_page(PAGE0, BCICTL2, 0x0019);
+	ABB_Write_Register_on_page(PAGE0, BCICTL2, 0x0019 | LEDC);
 }
 
 static void start_ci_charging(void)
@@ -298,6 +298,7 @@
 				RV_TRACE_LEVEL_DEBUG_LOW, FCHG_USE_ID);
 		if (!(msg->data[9] & CHGPRES)) {
 			pwr_ctrl->state = FCHG_STATE_NO_EXT_PWR;
+			pwr_init_discharge();
 			return;
 		}
 		start_ci_charging();
@@ -307,6 +308,7 @@
 		if (!(msg->data[9] & CHGPRES)) {
 			ABB_Write_Register_on_page(PAGE0, BCICTL2, 0);
 			pwr_ctrl->state = FCHG_STATE_NO_EXT_PWR;
+			pwr_init_discharge();
 			return;
 		}
 		if (charging_time_limit_check())
@@ -318,6 +320,7 @@
 		if (!(msg->data[9] & CHGPRES)) {
 			ABB_Write_Register_on_page(PAGE0, BCICTL2, 0);
 			pwr_ctrl->state = FCHG_STATE_NO_EXT_PWR;
+			pwr_init_discharge();
 			return;
 		}
 		if (cv_ichg_process(msg->data[2]))