FreeCalypso > hg > fc-magnetite
view src/cs/drivers/drv_app/fchg/fchg_ffs_init.c @ 574:41b6a18ffa0b
GPF rebuild from source: symlink magic to fix __FILE__
With this fix all of the core GPF libraries (frame_*, misc_* and tif_*)
compile into objects that perfectly match the original TCS211 binary
versions bit for bit. Prior to this fix there was an issue with TI's use
of __FILE__ expanding into longer pathnames that were an artifact of our
FC Magnetite build system, and it appears that these longer __FILE__
strings in GPF may have been causing some breakage in some error handling
paths.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 24 Jan 2019 23:26:51 +0000 |
parents | 562fa85c8963 |
children |
line wrap: on
line source
/* * In this module we implement the loading of the charging config * and the battery table from FFS. */ #include "fchg/fchg_env.h" #include "fchg/fchg_func_i.h" #include "rv/rv_general.h" #include "rvf/rvf_api.h" #include "rvm/rvm_use_id_list.h" #include "ffs/ffs_api.h" void pwr_load_ffs_charging_config(void) { int rc; rc = ffs_file_read("/etc/charging", &pwr_ctrl->config, sizeof(struct charging_config)); if (rc == sizeof(struct charging_config)) { pwr_ctrl->config_present = TRUE; rvf_send_trace( "FCHG: read charging config from FFS, charging enabled", 53, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, FCHG_USE_ID); } else { pwr_ctrl->config_present = FALSE; rvf_send_trace( "FCHG: no charging config in FFS, will not charge", 48, NULL_PARAM, RV_TRACE_LEVEL_WARNING, FCHG_USE_ID); } } void pwr_load_ffs_batt_table(void) { 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); rvf_send_trace("FCHG: battery table loaded from FFS", 35, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, FCHG_USE_ID); } else { pwr_set_default_batt_table(); rvf_send_trace("FCHG: using compiled-in default battery table", 45, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, FCHG_USE_ID); } }