comparison src/cs/drivers/drv_app/fchg/fchg_default_batt.c @ 0:92470e5d0b9e

src: partial import from FC Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 01:28:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92470e5d0b9e
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 "fchg/fchg_func_i.h"
10 #include "rv/rv_general.h"
11 #include <string.h>
12
13 static const T_PWR_THRESHOLDS default_batt_table[] = {
14 {4170, 100},
15 {4120, 95},
16 {4070, 90},
17 {4030, 85},
18 {3964, 80},
19 {3930, 75},
20 {3900, 70},
21 {3882, 65},
22 {3847, 60},
23 {3805, 55},
24 {3786, 50},
25 {3771, 45},
26 {3759, 40},
27 {3750, 35},
28 {3745, 30},
29 {3737, 25},
30 {3719, 20},
31 {3688, 15},
32 {3663, 10},
33 {3539, 5},
34 {3370, 0}
35 };
36
37 void pwr_set_default_batt_table(void)
38 {
39 memcpy(pwr_ctrl->batt_thresholds, default_batt_table,
40 sizeof default_batt_table);
41 pwr_ctrl->nb_thresholds = sizeof(default_batt_table) /
42 sizeof(T_PWR_THRESHOLDS);
43 }