Update main.c revert

sim-fail-2
Alan Johnston 4 months ago committed by GitHub
parent 7ee647cd57
commit 03f0b02fde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -78,7 +78,7 @@ int main(int argc, char * argv[]) {
} }
if (strcmp(sim_yes, "yes") == 0) { if (strcmp(sim_yes, "yes") == 0) {
= TRUE; sim_mode = TRUE;
fprintf(stderr, "Sim mode is turned ON by configuration\n"); fprintf(stderr, "Sim mode is turned ON by configuration\n");
sim_config = TRUE; sim_config = TRUE;
} }
@ -336,9 +336,9 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno)); fprintf(stderr, "Unable to open UART: %s\n -> Did you configure /boot/config.txt and /boot/cmdline.txt?\n", strerror(errno));
} }
if ((i2c_bus3 == OFF) || ( == TRUE)) { if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) {
= TRUE; sim_mode = TRUE;
fprintf(stderr, "Simulated telemetry mode!\n"); fprintf(stderr, "Simulated telemetry mode!\n");
@ -492,14 +492,14 @@ int main(int argc, char * argv[]) {
memset(sensor, 0, sizeof(sensor)); memset(sensor, 0, sizeof(sensor));
memset(other, 0, sizeof(other)); memset(other, 0, sizeof(other));
if (((mode == FSK) || (mode == BPSK))) // && !) if (((mode == FSK) || (mode == BPSK))) // && !sim_mode)
get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored
else if (((mode == FC))) // && !) else if (((mode == FC))) // && !sim_mode)
get_tlm_fc(); // fill transmit buffer with reset count 0 packets that will be ignored get_tlm_fc(); // fill transmit buffer with reset count 0 packets that will be ignored
firstTime = 1; firstTime = 1;
// if (!) // always read sensors, even in sim mode // if (!sim_mode) // always read sensors, even in sim mode
{ {
strcpy(pythonStr, pythonCmd); strcpy(pythonStr, pythonCmd);
strcat(pythonStr, busStr); strcat(pythonStr, busStr);
@ -830,7 +830,8 @@ int main(int argc, char * argv[]) {
// end of simulated telemetry // end of simulated telemetry
} }
else {
}
FILE * cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); FILE * cpuTempSensor = fopen("/sys/class/thermal/thermal_zone0/temp", "r");
if (cpuTempSensor) { if (cpuTempSensor) {
// double cpuTemp; // double cpuTemp;

Loading…
Cancel
Save

Powered by TurnKey Linux.