comparison src/cs/drivers/drv_app/fchg/fchg_process.c @ 360:ce6d71349af0

FCHG: data structure changes in preparation for the new version
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 29 Dec 2017 05:42:54 +0000
parents 2f41f7883261
children 4c3d05866531
comparison
equal deleted inserted replaced
359:edd20483fa59 360:ce6d71349af0
95 pwr_ctrl->state = FCHG_STATE_CV_CHARGING; 95 pwr_ctrl->state = FCHG_STATE_CV_CHARGING;
96 /* Select constant voltage charging. The charger is disabled */ 96 /* Select constant voltage charging. The charger is disabled */
97 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0); 97 ABB_Write_Register_on_page(PAGE0, BCICTL2, 0);
98 /* figure out the DAC code */ 98 /* figure out the DAC code */
99 while (code && 99 while (code &&
100 madc_vbat_2_physical(code) >= pwr_ctrl->config.charge_to_mv) 100 madc_vbat_2_physical(code) >= pwr_ctrl->config.cv_init_set)
101 code--; 101 code--;
102 code++; 102 code++;
103 rvf_send_trace("Voltage (DAC code) ", 19, code, 103 rvf_send_trace("Voltage (DAC code) ", 19, code,
104 RV_TRACE_LEVEL_DEBUG_LOW, FCHG_USE_ID); 104 RV_TRACE_LEVEL_DEBUG_LOW, FCHG_USE_ID);
105 /* Program the DAC with the constant voltage value */ 105 /* Program the DAC with the constant voltage value */
191 pwr_ctrl->state = FCHG_STATE_NO_EXT_PWR; 191 pwr_ctrl->state = FCHG_STATE_NO_EXT_PWR;
192 return; 192 return;
193 } 193 }
194 if (overvoltage_end_charge_check()) 194 if (overvoltage_end_charge_check())
195 return; 195 return;
196 if (pwr_ctrl->batt_mv >= pwr_ctrl->config.charge_to_mv) 196 if (pwr_ctrl->batt_mv >= pwr_ctrl->config.ci2cv_thresh)
197 start_cv_charging(msg->data[0]); 197 start_cv_charging(msg->data[0]);
198 return; 198 return;
199 case FCHG_STATE_CV_CHARGING: 199 case FCHG_STATE_CV_CHARGING:
200 charge_progress_trace("CV", msg->data[2]); 200 charge_progress_trace("CV", msg->data[2]);
201 if (!(msg->data[9] & CHGPRES)) { 201 if (!(msg->data[9] & CHGPRES)) {