Browse Source

AP_HAL_ChibiOS: add Link Quality reporting to RC protocols

gps-1.3.1
Hwurzburg 4 years ago committed by Andrew Tridgell
parent
commit
0f2f6ccc80
  1. 1
      libraries/AP_HAL_ChibiOS/RCInput.cpp
  2. 5
      libraries/AP_HAL_ChibiOS/RCInput.h

1
libraries/AP_HAL_ChibiOS/RCInput.cpp

@ -180,6 +180,7 @@ void RCInput::_timer_tick(void) @@ -180,6 +180,7 @@ void RCInput::_timer_tick(void)
_num_channels = MIN(_num_channels, RC_INPUT_MAX_CHANNELS);
rcprot.read(_rc_values, _num_channels);
_rssi = rcprot.get_RSSI();
_rx_link_quality = rcprot.get_rx_link_quality();
#ifndef HAL_NO_UARTDRIVER
rc_protocol = rcprot.protocol_name();
#endif

5
libraries/AP_HAL_ChibiOS/RCInput.h

@ -52,7 +52,9 @@ public: @@ -52,7 +52,9 @@ public:
int16_t get_rssi(void) override {
return _rssi;
}
int16_t get_rx_link_quality(void) override {
return _rx_link_quality;
}
const char *protocol() const override { return last_protocol; }
void _timer_tick(void);
@ -65,6 +67,7 @@ private: @@ -65,6 +67,7 @@ private:
uint8_t _num_channels;
Semaphore rcin_mutex;
int16_t _rssi = -1;
int16_t _rx_link_quality = -1;
uint32_t _rcin_timestamp_last_signal;
bool _init;
const char *last_protocol;

Loading…
Cancel
Save