Browse Source

AP_RCTelemetry: add RC option to report CRSF LQ as RSSI

Co-author: Jules Gilson <julesgilson@yahoo.co.uk>
gps-1.3.1
Hwurzburg 3 years ago committed by Andrew Tridgell
parent
commit
a18a4e5719
  1. 6
      libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp
  2. 2
      libraries/AP_RCTelemetry/AP_CRSF_Telem.h

6
libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp

@ -171,6 +171,12 @@ void AP_CRSF_Telem::process_rf_mode_changes() @@ -171,6 +171,12 @@ void AP_CRSF_Telem::process_rf_mode_changes()
if (_telem_last_report_ms == 0 && !uart->is_dma_enabled()) {
gcs().send_text(MAV_SEVERITY_WARNING, "CRSF: running on non-DMA serial port");
}
// note if option was set to show LQ in place of RSSI
bool current_lq_as_rssi_active = bool(rc().use_crsf_lq_as_rssi());
if(_telem_last_report_ms == 0 || _noted_lq_as_rssi_active != current_lq_as_rssi_active){
_noted_lq_as_rssi_active = current_lq_as_rssi_active;
gcs().send_text(MAV_SEVERITY_INFO, "CRSF: RSSI now displays %s", current_lq_as_rssi_active ? " as LQ" : "normally");
}
// report a change in RF mode or a chnage of more than 10Hz if we haven't done so in the last 5s
if ((now - _telem_last_report_ms > 5000) &&
(_telem_rf_mode != current_rf_mode || abs(int16_t(_telem_last_avg_rate) - int16_t(_scheduler.avg_packet_rate)) > 25)) {

2
libraries/AP_RCTelemetry/AP_CRSF_Telem.h

@ -351,6 +351,8 @@ private: @@ -351,6 +351,8 @@ private:
bool _vtx_power_change_pending;
bool _vtx_options_change_pending;
bool _noted_lq_as_rssi_active;
static AP_CRSF_Telem *singleton;
};

Loading…
Cancel
Save