diff --git a/main.c b/main.c index 1c89e9b3..c82dd2bd 100644 --- a/main.c +++ b/main.c @@ -89,7 +89,7 @@ int main(int argc, char * argv[]) { } if (strcmp(sim_yes, "yes") == 0) { - sim_mode = TRUE; + = TRUE; fprintf(stderr, "Sim mode is ON\n"); } if (strcmp(hab_yes, "yes") == 0) { @@ -429,10 +429,10 @@ int main(int argc, char * argv[]) { } } - if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { -// if (sim_mode == TRUE) { + if ((i2c_bus3 == OFF) || ( == TRUE)) { +// if ( == TRUE) { - sim_mode = TRUE; + = TRUE; fprintf(stderr, "Simulated telemetry mode!\n"); @@ -547,7 +547,7 @@ int main(int argc, char * argv[]) { memset(sensor, 0, sizeof(sensor)); memset(other, 0, sizeof(other)); - if (((mode == FSK) || (mode == BPSK))) // && !sim_mode) + if (((mode == FSK) || (mode == BPSK))) // && !) get_tlm_fox(); // fill transmit buffer with reset count 0 packets that will be ignored firstTime = 1; @@ -641,8 +641,11 @@ int main(int argc, char * argv[]) { } if (voltage[map[BAT]] == 0.0) batteryVoltage = 4.5; - else + else { batteryVoltage = voltage[map[BAT]]; + if (sim_mode) // if Voltage sensor on Battery board is present, exit simulated telemetry mode + sim_mode = FALSE; + } batteryCurrent = current[map[BAT]]; } @@ -792,7 +795,7 @@ int main(int argc, char * argv[]) { // end of simulated telemetry } - else { +// else { // code moved /* @@ -828,7 +831,7 @@ int main(int argc, char * argv[]) { batteryVoltage = voltage[map[BAT]]; batteryCurrent = current[map[BAT]]; */ - } +// } // batteryVoltage = voltage[map[BAT]]; // batteryCurrent = current[map[BAT]];