FreeCalypso > hg > fc-tourmaline
diff src/cs/drivers/drv_app/fchg/fchg_ffs_init.c @ 253:769cf6273fe4
FCHG: beginning of battery simulation mode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 May 2021 11:14:51 +0000 |
parents | 75067af48bfd |
children |
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/fchg/fchg_ffs_init.c Wed May 12 03:18:50 2021 +0000 +++ b/src/cs/drivers/drv_app/fchg/fchg_ffs_init.c Wed May 12 11:14:51 2021 +0000 @@ -50,3 +50,20 @@ FCHG_USE_ID); } } + +void pwr_check_ffs_bsim(void) +{ + int rc; + + rc = ffs_file_read("/etc/batterysim", &pwr_ctrl->bsim, + sizeof(struct bsim_config)); + if (rc == sizeof(struct bsim_config)) { + pwr_ctrl->bsim_mode = TRUE; + rvf_send_trace( + "FCHG: operating in battery simulation mode per FFS config!", + 58, NULL_PARAM, RV_TRACE_LEVEL_DEBUG_HIGH, + FCHG_USE_ID); + } else { + pwr_ctrl->bsim_mode = FALSE; + } +}