Merge pull request #311 from alanbjohnston/beta-sim

battery sensor sim mode detection
beta-hab
Alan Johnston 2 years ago committed by GitHub
commit 3b533e0ebc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -90,7 +90,8 @@ int main(int argc, char * argv[]) {
if (strcmp(sim_yes, "yes") == 0) { if (strcmp(sim_yes, "yes") == 0) {
sim_mode = TRUE; sim_mode = TRUE;
fprintf(stderr, "Sim mode is ON\n"); fprintf(stderr, "Sim mode is turned ON by configuration\n");
sim_config = TRUE;
} }
if (strcmp(hab_yes, "yes") == 0) { if (strcmp(hab_yes, "yes") == 0) {
hab_mode = TRUE; hab_mode = TRUE;
@ -641,8 +642,13 @@ 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 && !sim_config) { // if Voltage sensor on Battery board is present, exit simulated telemetry mode
sim_mode = FALSE;
fprintf(stderr, "Turning off sim_mode since battery sensor is present\n");
}
}
batteryCurrent = current[map[BAT]]; batteryCurrent = current[map[BAT]];
} }

@ -149,6 +149,7 @@ long int newGpsTime;
float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse; float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse;
int i2c_bus0 = OFF, i2c_bus1 = OFF, i2c_bus3 = OFF, camera = OFF, sim_mode = FALSE, SafeMode = FALSE, rxAntennaDeployed = 0, txAntennaDeployed = 0; int i2c_bus0 = OFF, i2c_bus1 = OFF, i2c_bus3 = OFF, camera = OFF, sim_mode = FALSE, SafeMode = FALSE, rxAntennaDeployed = 0, txAntennaDeployed = 0;
int sim_config = FALSE; // sim mode not set by configuration
double eclipse_time; double eclipse_time;
float voltage[9], current[9], sensor[SENSOR_FIELDS], other[3]; float voltage[9], current[9], sensor[SENSOR_FIELDS], other[3];

Loading…
Cancel
Save

Powered by TurnKey Linux.