Update main.c exit sim_mode if battery voltage sensor present

beta-sim
Alan Johnston 2 years ago committed by GitHub
parent c4b18a1e2d
commit 32275c8d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -89,7 +89,7 @@ int main(int argc, char * argv[]) {
} }
if (strcmp(sim_yes, "yes") == 0) { if (strcmp(sim_yes, "yes") == 0) {
sim_mode = TRUE; = TRUE;
fprintf(stderr, "Sim mode is ON\n"); fprintf(stderr, "Sim mode is ON\n");
} }
if (strcmp(hab_yes, "yes") == 0) { if (strcmp(hab_yes, "yes") == 0) {
@ -429,10 +429,10 @@ int main(int argc, char * argv[]) {
} }
} }
if ((i2c_bus3 == OFF) || (sim_mode == TRUE)) { if ((i2c_bus3 == OFF) || ( == TRUE)) {
// if (sim_mode == TRUE) { // if ( == TRUE) {
sim_mode = TRUE; = TRUE;
fprintf(stderr, "Simulated telemetry mode!\n"); fprintf(stderr, "Simulated telemetry mode!\n");
@ -547,7 +547,7 @@ 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))) // && !sim_mode) if (((mode == FSK) || (mode == BPSK))) // && !)
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
firstTime = 1; firstTime = 1;
@ -641,8 +641,11 @@ int main(int argc, char * argv[]) {
} }
if (voltage[map[BAT]] == 0.0) if (voltage[map[BAT]] == 0.0)
batteryVoltage = 4.5; batteryVoltage = 4.5;
else else {
batteryVoltage = voltage[map[BAT]]; 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]]; batteryCurrent = current[map[BAT]];
} }
@ -792,7 +795,7 @@ int main(int argc, char * argv[]) {
// end of simulated telemetry // end of simulated telemetry
} }
else { // else {
// code moved // code moved
/* /*
@ -828,7 +831,7 @@ int main(int argc, char * argv[]) {
batteryVoltage = voltage[map[BAT]]; batteryVoltage = voltage[map[BAT]];
batteryCurrent = current[map[BAT]]; batteryCurrent = current[map[BAT]];
*/ */
} // }
// batteryVoltage = voltage[map[BAT]]; // batteryVoltage = voltage[map[BAT]];
// batteryCurrent = current[map[BAT]]; // batteryCurrent = current[map[BAT]];

Loading…
Cancel
Save

Powered by TurnKey Linux.