Update main.c zero out DTEMP and XS if payload fail

master-psag-fm-only-fsk
Alan Johnston 2 weeks ago committed by GitHub
parent b04f32b5dd
commit e70b24e360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1774,14 +1774,21 @@ void get_tlm_fox() {
encodeA(b_max, 42 + head_offset, (int)(sensor_max[GYRO_Y] + 0.5) + 2048);
encodeB(b_max, 43 + head_offset, (int)(sensor_max[GYRO_Z] + 0.5) + 2048);
encodeA(b_max, 48 + head_offset, (int)(sensor_max[DTEMP] * 10 + 0.5) + 2048);
// encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1] * 10 + 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] * 10 + 0.5));
encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1]));
encodeA(b_max, 0 + head_offset, (int)(sensor_max[XS2]));
encodeB(b_max, 1 + head_offset, (int)(sensor_max[XS3]));
if (failureMode != FAIL_PAYLOAD) {
encodeA(b_max, 48 + head_offset, (int)(sensor_max[DTEMP] * 10 + 0.5) + 2048);
encodeB(b_max, 49 + head_offset, (int)(sensor_max[XS1]));
encodeA(b_max, 0 + head_offset, (int)(sensor_max[XS2]));
encodeB(b_max, 1 + head_offset, (int)(sensor_max[XS3]));
}
else {
encodeA(b_max, 48 + head_offset, 2048);
encodeB(b_max, 49 + head_offset, 0);
encodeA(b_max, 0 + head_offset, 0);
encodeB(b_max, 1 + head_offset, 0);
}
} else {
encodeB(b_max, 4 + head_offset, 2048); // 0
encodeA(b_max, 6 + head_offset, 2048); // 0
@ -1830,14 +1837,22 @@ void get_tlm_fox() {
encodeA(b_min, 42 + head_offset, (int)(sensor_min[GYRO_Y] + 0.5) + 2048);
encodeB(b_min, 43 + head_offset, (int)(sensor_min[GYRO_Z] + 0.5) + 2048);
encodeA(b_min, 48 + head_offset, (int)(sensor_min[DTEMP] * 10 + 0.5) + 2048);
// encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1] * 10 + 0.5) + 2048);
encodeB(b_min, 10 + head_offset, (int)(sensor_min[TEMP] * 10 + 0.5));
encodeA(b_min, 45 + head_offset, (int)(sensor_min[HUMI] * 10 + 0.5));
encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1]));
encodeA(b_min, 0 + head_offset, (int)(sensor_min[XS2]));
encodeB(b_min, 1 + head_offset, (int)(sensor_min[XS3]));
if (failureMode != FAIL_PAYLOAD) {
encodeA(b_min, 48 + head_offset, (int)(sensor_min[DTEMP] * 10 + 0.5) + 2048);
encodeB(b_min, 49 + head_offset, (int)(sensor_min[XS1]));
encodeA(b_min, 0 + head_offset, (int)(sensor_min[XS2]));
encodeB(b_min, 1 + head_offset, (int)(sensor_min[XS3]));
}
else {
encodeA(b_min, 48 + head_offset, 2048);
encodeB(b_min, 49 + head_offset, 0);
encodeA(b_min, 0 + head_offset, 0);
encodeB(b_min, 1 + head_offset, 0);
}
} else {
encodeB(b_min, 4 + head_offset, 2048); // 0
encodeA(b_min, 6 + head_offset, 2048); // 0
@ -1893,10 +1908,19 @@ void get_tlm_fox() {
encodeB(b, 40 + head_offset, (int)(sensor[GYRO_X] + 0.5) + 2048);
encodeA(b, 42 + head_offset, (int)(sensor[GYRO_Y] + 0.5) + 2048);
encodeB(b, 43 + head_offset, (int)(sensor[GYRO_Z] + 0.5) + 2048);
encodeA(b, 48 + head_offset, (int)(sensor[DTEMP] * 10 + 0.5) + 2048);
encodeB(b, 49 + head_offset, (int)(sensor[XS1]));
encodeA(b, 0 + head_offset, (int)(sensor[XS2]));
encodeB(b, 1 + head_offset, (int)(sensor[XS3]));
if (failureMode != FAIL_PAYLOAD) {
encodeA(b, 48 + head_offset, (int)(sensor[DTEMP] * 10 + 0.5) + 2048);
encodeB(b, 49 + head_offset, (int)(sensor[XS1]));
encodeA(b, 0 + head_offset, (int)(sensor[XS2]));
encodeB(b, 1 + head_offset, (int)(sensor[XS3]));
}
else {
encodeA(b, 48 + head_offset, 2048);
encodeB(b, 49 + head_offset, 0);
encodeA(b, 0 + head_offset, 0);
encodeB(b, 1 + head_offset, 0);
}
encodeB(b, 46 + head_offset, BAT2Current);
encodeA(b, 39 + head_offset, (int)(other[IHU_TEMP] * 10 + 0.5));

Loading…
Cancel
Save

Powered by TurnKey Linux.