1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

Add MSP message for reading air speed

This commit is contained in:
Michel Pastor 2018-03-01 04:00:35 +01:00
parent 1a9663c59f
commit 85f98ecc01
4 changed files with 15 additions and 2 deletions

View file

@ -1285,6 +1285,14 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
sbufWriteU16(dst, (uint16_t)timeConfig()->tz_offset);
break;
case MSP2_INAV_AIR_SPEED:
#ifdef USE_PITOT
sbufWriteU32(dst, pitot.airSpeed);
#else
sbufWriteU32(dst, 0);
#endif
break;
default:
return false;
}

View file

@ -27,3 +27,4 @@
#define MSP2_INAV_SET_BATTERY_CONFIG 0x2006
#define MSP2_INAV_RATE_PROFILE 0x2007
#define MSP2_INAV_SET_RATE_PROFILE 0x2008
#define MSP2_INAV_AIR_SPEED 0x2009

View file

@ -42,10 +42,10 @@
#include "sensors/pitotmeter.h"
#include "sensors/sensors.h"
pitot_t pitot;
#ifdef USE_PITOT
pitot_t pitot;
static timeMs_t pitotCalibrationTimeout = 0;
static bool pitotCalibrationFinished = false;
static float pitotPressureZero = 0;

View file

@ -47,6 +47,8 @@ typedef struct pito_s {
int32_t airSpeed;
} pitot_t;
#ifdef USE_PITOT
extern pitot_t pitot;
bool pitotInit(void);
@ -55,3 +57,5 @@ void pitotStartCalibration(void);
uint32_t pitotUpdate(void);
int32_t pitotCalculateAirSpeed(void);
bool pitotIsHealthy(void);
#endif