From 75db343fd22eefc5b69d836e6ea5568990ee23a9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 12 Dec 2020 17:36:10 -0500 Subject: [PATCH] check for valid values in sensor max and min before writing --- afsk/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 0d8357fc..8c00fbe4 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1394,7 +1394,8 @@ if (sim_mode) voltage[count1] = voltage_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) @@ -1410,7 +1411,8 @@ if (sim_mode) voltage[count1] = voltage_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]; } }