|
@@ -4,6 +4,9 @@
|
|
|
|
|
|
|
|
BatteryInfo battery_data[NUM_SLOTS];
|
|
BatteryInfo battery_data[NUM_SLOTS];
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//Initialize battery struct
|
|
//Initialize battery struct
|
|
|
void Battery_Init(){
|
|
void Battery_Init(){
|
|
|
for(uint8_t i=0; i<NUM_SLOTS; i++){
|
|
for(uint8_t i=0; i<NUM_SLOTS; i++){
|
|
@@ -29,7 +32,7 @@ void Battery_ReadState(uint8_t slot_id){
|
|
|
battery_data[slot_id].max_voltage==0 &&
|
|
battery_data[slot_id].max_voltage==0 &&
|
|
|
battery_data[slot_id].cut_off_current==0){
|
|
battery_data[slot_id].cut_off_current==0){
|
|
|
battery_data[slot_id].battery_state = STATE_WAITING_FOR_LIMITS;
|
|
battery_data[slot_id].battery_state = STATE_WAITING_FOR_LIMITS;
|
|
|
- printf("Waiting to receive battery limits to start charging/discharging\n");
|
|
|
|
|
|
|
+ //printf("Waiting to receive battery limits to start charging/discharging\n");
|
|
|
}
|
|
}
|
|
|
else if(battery_data[slot_id].battery_measurement.voltage < BATTERY_THRESHOLD){
|
|
else if(battery_data[slot_id].battery_measurement.voltage < BATTERY_THRESHOLD){
|
|
|
battery_data[slot_id].battery_state = STATE_EMPTY;
|
|
battery_data[slot_id].battery_state = STATE_EMPTY;
|