Skip to content

Commit f895375

Browse files
committed
AP_RCTelemetry: rename sensor_status_flags to unhealthy_sensors
the current name doesn't tell you much, and definitely doesn't hint that it's returning you which sensors are not present and enabled but not healthy
1 parent 01693ed commit f895375

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

libraries/AP_RCTelemetry/AP_RCTelemetry.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ uint8_t AP_RCTelemetry::run_wfq_scheduler(const bool use_shaper)
9999
float delay = 0;
100100
bool packet_ready = false;
101101

102-
// build message queue for sensor_status_flags
102+
// build message queue for unhealthy_sensors()
103103
check_sensor_status_flags();
104104
// build message queue for ekf_status
105105
check_ekf_status();
@@ -187,13 +187,13 @@ void AP_RCTelemetry::queue_message(MAV_SEVERITY severity, const char *text)
187187
}
188188

189189
/*
190-
* add sensor_status_flags information to message cue, normally passed as sys_status mavlink messages to the GCS, for transmission through FrSky link
190+
* add unhealthy_sensors() information to message cue, normally passed as sys_status mavlink messages to the GCS, for transmission through FrSky link
191191
*/
192192
void AP_RCTelemetry::check_sensor_status_flags(void)
193193
{
194194
uint32_t now = AP_HAL::millis();
195195

196-
const uint32_t _sensor_status_flags = sensor_status_flags();
196+
const uint32_t _sensor_status_flags = unhealthy_sensors();
197197

198198
if ((now - check_sensor_status_timer) >= 5000) { // prevent repeating any system_status messages unless 5 seconds have passed
199199
// only one error is reported at a time (in order of preference). Same setup and displayed messages as Mission Planner.
@@ -279,7 +279,9 @@ void AP_RCTelemetry::check_ekf_status(void)
279279
}
280280
}
281281

282-
uint32_t AP_RCTelemetry::sensor_status_flags() const
282+
// returns a bitmask of sensors which are present and enabled but also
283+
// not healthy
284+
uint32_t AP_RCTelemetry::unhealthy_sensors() const
283285
{
284286
uint32_t present;
285287
uint32_t enabled;

libraries/AP_RCTelemetry/AP_RCTelemetry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class AP_RCTelemetry {
7070
// MAV_SYS_STATUS_* values from mavlink. If a bit is set then it
7171
// indicates that the sensor or subsystem is present but not
7272
// functioning correctly
73-
uint32_t sensor_status_flags() const;
73+
uint32_t unhealthy_sensors() const;
7474
uint16_t get_avg_packet_rate() const {
7575
return _scheduler.avg_packet_rate;
7676
}

0 commit comments

Comments
 (0)