comparison src/cs/drivers/drv_app/fchg/fchg_default_batt.c @ 324:6ab14029931c

FCHG: default battery table implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 05 Dec 2017 01:29:04 +0000
parents
children 919b44c991fc
comparison
equal deleted inserted replaced
323:f08212cf0b04 324:6ab14029931c
1 /*
2 * This module provides the default table of battery State-of-Charge
3 * thresholds in the absence of a customized table in FFS.
4 *
5 * The present default table has been taken from Pirelli's firmware.
6 */
7
8 #include "fchg/fchg_env.h"
9 #include "rv/rv_general.h"
10 #include <string.h>
11
12 static const T_PWR_THRESHOLDS default_batt_table[] = {
13 {4170, 100},
14 {4120, 95},
15 {4070, 90},
16 {4030, 85},
17 {3964, 80},
18 {3930, 75},
19 {3900, 70},
20 {3882, 65},
21 {3847, 60},
22 {3805, 55},
23 {3786, 50},
24 {3771, 45},
25 {3759, 40},
26 {3750, 35},
27 {3745, 30},
28 {3737, 25},
29 {3719, 20},
30 {3688, 15},
31 {3663, 10},
32 {3539, 5},
33 {3370, 0}
34 };
35
36 void pwr_set_default_batt_table(void)
37 {
38 memcpy(pwr_ctrl->batt_thresholds, default_batt_table,
39 sizeof default_batt_table);
40 pwr_ctrl->nb_thresholds = sizeof(default_batt_table) /
41 sizeof(T_PWR_THRESHOLDS);
42 }