HAL_ChibiOS: display decoded RC protocol

This commit is contained in:
Andrew Tridgell 2018-11-03 09:49:41 +11:00
parent d87bef16a2
commit dbc05f787b
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ extern AP_IOMCU iomcu;
#endif
#include <AP_Math/AP_Math.h>
#include <GCS_MAVLink/GCS.h>
#define SIG_DETECT_TIMEOUT_US 500000
using namespace ChibiOS;
@ -132,6 +133,10 @@ void RCInput::_timer_tick(void)
_rc_values[i] = rcin_prot.read(i);
}
rcin_mutex.give();
if (rcin_prot.protocol_name() != last_protocol) {
last_protocol = rcin_prot.protocol_name();
gcs().send_text(MAV_SEVERITY_DEBUG, "RCInput: decoding %s", last_protocol);
}
}
#endif

View File

@ -62,6 +62,8 @@ private:
int16_t _rssi = -1;
uint32_t _rcin_timestamp_last_signal;
bool _init;
const char *last_protocol;
#if HAL_RCINPUT_WITH_AP_RADIO
bool _radio_init;
AP_Radio *radio;