AP_HAL_ChibiOS: add Link Quality reporting to RC protocols

This commit is contained in:
Hwurzburg 2021-07-12 14:03:44 -05:00 committed by Andrew Tridgell
parent e52b9f78c2
commit 0f2f6ccc80
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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:
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;