Make it possible to reference this information via the variable
array. This makes it possible to for example have the log file name to
contain the number of battery cells and charger state.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
for (j = 0; j < max_cells; j++, i++) {
d = atoi(entries[i]);
ASSIGN_OR_NAN(data->cell_voltage[j], d / 1000.0);
+
+ if (d)
+ data->cell_count++;
}
d = atoi(entries[i++]);
return 0;
if (state_has_changed()) {
+ store_str_variable_value_to_array("status",
+ state_to_str(plotter_state.system_status), dt->cfg);
+
+ store_int_variable_value_to_array("cell_count",
+ data.cell_count, dt->cfg);
+
ret = open_new_logfile(dt, data.channel);
if (ret < 0)
return ret;
double input_voltage;
double charging_voltage;
double charging_current;
+ int cell_count;
double cell_voltage[MAX_CELLS];
double total_charge; /* mAh */