Subsystem_info status flags & checks: Moved the set_health_flags helper functions out of the /lib/ folder and into the module/commander folder because they are actually only needed there

This commit is contained in:
Philipp Oettershagen
2018-06-06 18:54:24 +02:00
committed by Beat Küng
parent bd2af289f5
commit 302cb0a285
9 changed files with 10 additions and 46 deletions
-1
View File
@@ -51,5 +51,4 @@ px4_add_module(
drivers__device
git_ecl
ecl_validation
health_flags
)
+4 -4
View File
@@ -920,17 +920,17 @@ bool VotedSensorsUpdate::check_failover(SensorData &sensor, const char *sensor_n
// reduce priority of failed sensor to the minimum
sensor.priority[failover_index] = 1;
// Update the subsystem_info uORB given that a sensor failed
PX4_ERR("Sensor %s #%i failed. Reconfiguring sensor priorities.", sensor_name, failover_index);
int ctr_valid = 0;
for (uint8_t i = 0; i < sensor.subscription_count; i++) {
if (sensor.priority[i] > 1) { ctr_valid++; }
PX4_WARN("FAILOVER event (idx=%u)! Sensor %s: Nr. %u Priority: %u", failover_index, sensor_name, i, sensor.priority[i]);
PX4_WARN("Remaining sensors after failover event %u: %s #%u priority: %u", failover_index, sensor_name, i,
sensor.priority[i]);
}
PX4_ERR("%s sensor switch from #%i", sensor_name, failover_index);
if (ctr_valid < 2) {
if (ctr_valid == 0) {
// Zero valid sensors remain! Set even the primary sensor health to false