Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@
#include "sensors/opflow.h"
#include "sensors/temperature.h"
#include "sensors/esc_sensor.h"
#ifdef USE_WIND_ESTIMATOR
#include "flight/wind_estimator.h"
#endif

#include "telemetry/telemetry.h"

Expand Down Expand Up @@ -1595,6 +1598,19 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
#endif
break;

case MSP2_INAV_WIND:
#ifdef USE_WIND_ESTIMATOR
{
uint16_t windAngle = 0;
sbufWriteU16(dst, (uint16_t)getEstimatedHorizontalWindSpeed(&windAngle));
sbufWriteU16(dst, windAngle / 100);
}
#else
sbufWriteU16(dst, 0);
sbufWriteU16(dst, 0);
#endif
break;

case MSP2_INAV_MIXER:
sbufWriteU8(dst, mixerConfig()->motorDirectionInverted);
sbufWriteU8(dst, 0);
Expand Down
4 changes: 3 additions & 1 deletion src/main/msp/msp_protocol_v2_inav.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@
#define MSP2_INAV_SET_WP_INDEX 0x2221 //in message jump to waypoint N during active WP mission; payload: U8 wp_index (0-based, relative to mission start)
#define MSP2_INAV_SET_CRUISE_HEADING 0x2223 //in message set heading while in Cruise/Course Hold mode; payload: I32 heading_centidegrees (0-35999)

#define MSP2_INAV_SET_AUX_RC 0x2230
#define MSP2_INAV_SET_AUX_RC 0x2230

#define MSP2_INAV_WIND 0x2231