Add support for PX4 RSSI (#4559)
This commit is contained in:
@@ -117,7 +117,15 @@ static inline void REC_MAVLINK_MSG_ID_SYS_STATUS(const mavlink_message_t* msg) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Recive rc channels
|
/*! \brief Receive rc channels
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static inline void REC_MAVLINK_MSG_ID_RC_CHANNELS(const mavlink_message_t* msg) {
|
||||||
|
uint8_t temp_scale = 5 + g_model.mavlink.rc_rssi_scale;
|
||||||
|
telemetry_data.rc_rssi = mavlink_msg_rc_channels_get_rssi(msg) * 20 / temp_scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \brief Receive raw rc channels
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static inline void REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(const mavlink_message_t* msg) {
|
static inline void REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(const mavlink_message_t* msg) {
|
||||||
@@ -369,6 +377,9 @@ static inline void handleMessage(mavlink_message_t* p_rxmsg) {
|
|||||||
case MAVLINK_MSG_ID_SYS_STATUS:
|
case MAVLINK_MSG_ID_SYS_STATUS:
|
||||||
REC_MAVLINK_MSG_ID_SYS_STATUS(p_rxmsg);
|
REC_MAVLINK_MSG_ID_SYS_STATUS(p_rxmsg);
|
||||||
break;
|
break;
|
||||||
|
case MAVLINK_MSG_ID_RC_CHANNELS:
|
||||||
|
REC_MAVLINK_MSG_ID_RC_CHANNELS(p_rxmsg);
|
||||||
|
break;
|
||||||
case MAVLINK_MSG_ID_RC_CHANNELS_RAW:
|
case MAVLINK_MSG_ID_RC_CHANNELS_RAW:
|
||||||
REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(p_rxmsg);
|
REC_MAVLINK_MSG_ID_RC_CHANNELS_RAW(p_rxmsg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user