check for valid values in sensor max and min before writing

pull/74/head
alanbjohnston 5 years ago committed by GitHub
parent 26f8a15cb3
commit 75db343fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1394,7 +1394,8 @@ if (sim_mode)
voltage[count1] = voltage_min[count1]; voltage[count1] = voltage_min[count1];
current[count1] = current_min[count1]; current[count1] = current_min[count1];
} }
sensor[count1] = sensor_min[count1]; if (sensor_min[count1] != 1000.0; // make sure values are valid
sensor[count1] = sensor_min[count1];
} }
} }
if ((loop + 4) % 8 == 0) if ((loop + 4) % 8 == 0)
@ -1410,7 +1411,8 @@ if (sim_mode)
voltage[count1] = voltage_max[count1]; voltage[count1] = voltage_max[count1];
current[count1] = current_max[count1]; current[count1] = current_max[count1];
} }
sensor[count1] = sensor_max[count1]; if (sensor_max[count1] != -1000.0; // make sure values are valid
sensor[count1] = sensor_max[count1];
} }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.