diff src/cs/drivers/drv_app/fchg/fchg_ffs_init.c @ 61:75067af48bfd

FCHG updates for Tourmaline UI integration
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 22 Oct 2020 22:30:49 +0000
parents 4e78acac3d88
children 769cf6273fe4
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/fchg/fchg_ffs_init.c	Wed Oct 21 03:31:04 2020 +0000
+++ b/src/cs/drivers/drv_app/fchg/fchg_ffs_init.c	Thu Oct 22 22:30:49 2020 +0000
@@ -35,10 +35,11 @@
 {
 	int rc;
 
-	rc = ffs_file_read("/etc/batterytab", pwr_ctrl->batt_thresholds,
-			   sizeof(pwr_ctrl->batt_thresholds));
-	if (rc >= (int)sizeof(T_PWR_THRESHOLDS)) {
-		pwr_ctrl->nb_thresholds = rc / sizeof(T_PWR_THRESHOLDS);
+	rc = ffs_file_read("/etc/batterytab2", &pwr_ctrl->batt,
+			   sizeof(struct battery_config));
+	if (rc >= (int)(sizeof(T_PWR_THRESHOLDS) * MIN_PERCENT_THRESH + 4)) {
+		pwr_ctrl->nb_percent_thresh =
+					(rc - 4) / sizeof(T_PWR_THRESHOLDS);
 		rvf_send_trace("FCHG: battery table loaded from FFS", 35,
 				NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH,
 				FCHG_USE_ID);