diff src/cs/drivers/drv_app/fchg/fchg_default_batt.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
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/fchg/fchg_default_batt.c	Wed Oct 21 03:31:04 2020 +0000
+++ b/src/cs/drivers/drv_app/fchg/fchg_default_batt.c	Thu Oct 22 22:30:49 2020 +0000
@@ -17,27 +17,31 @@
 	{4030, 85},
 	{3964, 80},
 	{3930, 75},
-	{3900, 70},
+	{3900, 70},	/* 4 bars */
 	{3882, 65},
 	{3847, 60},
 	{3805, 55},
-	{3786, 50},
+	{3786, 50},	/* 3 bars */
 	{3771, 45},
 	{3759, 40},
 	{3750, 35},
 	{3745, 30},
-	{3737, 25},
+	{3737, 25},	/* 2 bars */
 	{3719, 20},
 	{3688, 15},
 	{3663, 10},
-	{3539, 5},
+	{3539, 5},	/* 1 bar */
 	{3370, 0}
 };
 
+static const UINT8 default_batt_bars_table[NB_BARS_THRESH] = {6, 10, 15, 19};
+
 void pwr_set_default_batt_table(void)
 {
-	memcpy(pwr_ctrl->batt_thresholds, default_batt_table,
+	memcpy(pwr_ctrl->batt.percent_thresh, default_batt_table,
 		sizeof default_batt_table);
-	pwr_ctrl->nb_thresholds = sizeof(default_batt_table) /
-				  sizeof(T_PWR_THRESHOLDS);
+	pwr_ctrl->nb_percent_thresh = sizeof(default_batt_table) /
+				      sizeof(T_PWR_THRESHOLDS);
+	memcpy(pwr_ctrl->batt.bars_thresh, default_batt_bars_table,
+		sizeof default_batt_bars_table);
 }