From 869e2da2daee4f54448379e6866507e8e8a4851d Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 1 Jun 2021 14:03:54 -0400 Subject: [PATCH] added zero values if no max or min --- afsk/main.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index cb5546e2..bd4cec5a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1537,7 +1537,24 @@ void get_tlm_fox() { encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS3] * 100 + 0.5) + 2048); encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); - } + } + else + { + encodeB(b_max, 4 + head_offset, 2048); // 0 + encodeA(b_max, 6 + head_offset, 2048); // 0 + encodeB(b_max, 7 + head_offset, 2048); // 0 + +// encodeA(b_max, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure +// encodeB(b_max, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_max, 40 + head_offset, 2048); + encodeA(b_max, 42 + head_offset, 2048); + encodeB(b_max, 43 + head_offset, 2048); + + encodeA(b_max, 48 + head_offset, 2048); + encodeB(b_max, 49 + head_offset, 2048); +// encodeB(b_max, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); +// encodeA(b_max, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + } encodeA(b_min, 12 + head_offset, (int)(voltage_min[map[PLUS_X]] * 100)); encodeB(b_min, 13 + head_offset, (int)(voltage_min[map[PLUS_Y]] * 100)); encodeA(b_min, 15 + head_offset, (int)(voltage_min[map[PLUS_Z]] * 100)); @@ -1578,6 +1595,23 @@ void get_tlm_fox() { encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5)); encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] + 0.5)); } + else + { + encodeB(b_min, 4 + head_offset, 2048); // 0 + encodeA(b_min, 6 + head_offset, 2048); // 0 + encodeB(b_min, 7 + head_offset, 2048); // 0 + +// encodeA(b_min, 33 + head_offset, (int)(sensor_max[PRES] + 0.5)); // Pressure +// encodeB(b_min, 34 + head_offset, (int)(sensor_max[ALT] * 10.0 + 0.5)); // Altitude + encodeB(b_min, 40 + head_offset, 2048); + encodeA(b_min, 42 + head_offset, 2048); + encodeB(b_min, 43 + head_offset, 2048); + + encodeA(b_min, 48 + head_offset, 2048); + encodeB(b_min, 49 + head_offset, 2048); +// encodeB(b_min, 10 + head_offset, (int)(sensor_max[TEMP] * 10 + 0.5)); +// encodeA(b_min, 45 + head_offset, (int)(sensor_max[HUMI] + 0.5)); + } } encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048);