|
|
@@ -110,30 +110,28 @@ int main(void)
|
|
|
|
|
|
while(1)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
for(uint8_t slot_id= 0; slot_id< NUM_SLOTS; slot_id++){
|
|
|
if(picommandPending)
|
|
|
{ //printf("Pi Interrupt Triggered.\n");
|
|
|
pi_i2c_mcu();
|
|
|
picommandPending = false;
|
|
|
}
|
|
|
-
|
|
|
//GET battery measurement from the Target
|
|
|
- printf("Reading Battery Measurement for slot %d\n", slot_id);
|
|
|
controllerGetBatteryMeasurement(slot_id);
|
|
|
|
|
|
//Reading battery state:
|
|
|
Battery_StateCondition(slot_id);
|
|
|
|
|
|
- printf("Battery State: %d, Charging State:%d\n", battery_data[slot_id].battery_state, battery_data[slot_id].battery_charging_state);
|
|
|
+ //printf("Battery State: %d, Charging State:%d\n", battery_data[slot_id].battery_state, battery_data[slot_id].battery_charging_state);
|
|
|
|
|
|
//function for CC-CV Charging cycle
|
|
|
CC_CV_ControlCharging(slot_id);
|
|
|
|
|
|
- /*if(battery_data[slot_id].batteryLimitReceived){
|
|
|
+ if(battery_data[slot_id].batteryLimitReceived){
|
|
|
printf("Slot Id: %d, Min Voltage: %d, Max Voltage: %d, Charge Fraction:%d, Capacitance: %d, CutOff Current:%d\n",slot_id, battery_data[slot_id].min_voltage, battery_data[slot_id].max_voltage,
|
|
|
battery_data[slot_id].charge_fraction, battery_data[slot_id].capacitance, battery_data[slot_id].cut_off_current);
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
delay_cycles(MEASUREMENT_CHECK_INTERVAL);
|
|
|
|