1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

Add support for PX4 RSSI (#4559)

This commit is contained in:
alteman 2017-03-05 19:41:15 +03:00 committed by Bertrand Songis
parent cd6eef2cfa
commit d9c95f97d7

View file

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