FreeCalypso > hg > fc-tourmaline
comparison 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 |
comparison
equal
deleted
inserted
replaced
60:48f280c19e16 | 61:75067af48bfd |
---|---|
33 | 33 |
34 void pwr_load_ffs_batt_table(void) | 34 void pwr_load_ffs_batt_table(void) |
35 { | 35 { |
36 int rc; | 36 int rc; |
37 | 37 |
38 rc = ffs_file_read("/etc/batterytab", pwr_ctrl->batt_thresholds, | 38 rc = ffs_file_read("/etc/batterytab2", &pwr_ctrl->batt, |
39 sizeof(pwr_ctrl->batt_thresholds)); | 39 sizeof(struct battery_config)); |
40 if (rc >= (int)sizeof(T_PWR_THRESHOLDS)) { | 40 if (rc >= (int)(sizeof(T_PWR_THRESHOLDS) * MIN_PERCENT_THRESH + 4)) { |
41 pwr_ctrl->nb_thresholds = rc / sizeof(T_PWR_THRESHOLDS); | 41 pwr_ctrl->nb_percent_thresh = |
42 (rc - 4) / sizeof(T_PWR_THRESHOLDS); | |
42 rvf_send_trace("FCHG: battery table loaded from FFS", 35, | 43 rvf_send_trace("FCHG: battery table loaded from FFS", 35, |
43 NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, | 44 NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, |
44 FCHG_USE_ID); | 45 FCHG_USE_ID); |
45 } else { | 46 } else { |
46 pwr_set_default_batt_table(); | 47 pwr_set_default_batt_table(); |