mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 17:55:28 +03:00
Add MSP message for reading air speed
This commit is contained in:
parent
1a9663c59f
commit
85f98ecc01
4 changed files with 15 additions and 2 deletions
|
@ -1285,6 +1285,14 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
||||||
sbufWriteU16(dst, (uint16_t)timeConfig()->tz_offset);
|
sbufWriteU16(dst, (uint16_t)timeConfig()->tz_offset);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MSP2_INAV_AIR_SPEED:
|
||||||
|
#ifdef USE_PITOT
|
||||||
|
sbufWriteU32(dst, pitot.airSpeed);
|
||||||
|
#else
|
||||||
|
sbufWriteU32(dst, 0);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,3 +27,4 @@
|
||||||
#define MSP2_INAV_SET_BATTERY_CONFIG 0x2006
|
#define MSP2_INAV_SET_BATTERY_CONFIG 0x2006
|
||||||
#define MSP2_INAV_RATE_PROFILE 0x2007
|
#define MSP2_INAV_RATE_PROFILE 0x2007
|
||||||
#define MSP2_INAV_SET_RATE_PROFILE 0x2008
|
#define MSP2_INAV_SET_RATE_PROFILE 0x2008
|
||||||
|
#define MSP2_INAV_AIR_SPEED 0x2009
|
||||||
|
|
|
@ -42,10 +42,10 @@
|
||||||
#include "sensors/pitotmeter.h"
|
#include "sensors/pitotmeter.h"
|
||||||
#include "sensors/sensors.h"
|
#include "sensors/sensors.h"
|
||||||
|
|
||||||
pitot_t pitot;
|
|
||||||
|
|
||||||
#ifdef USE_PITOT
|
#ifdef USE_PITOT
|
||||||
|
|
||||||
|
pitot_t pitot;
|
||||||
|
|
||||||
static timeMs_t pitotCalibrationTimeout = 0;
|
static timeMs_t pitotCalibrationTimeout = 0;
|
||||||
static bool pitotCalibrationFinished = false;
|
static bool pitotCalibrationFinished = false;
|
||||||
static float pitotPressureZero = 0;
|
static float pitotPressureZero = 0;
|
||||||
|
|
|
@ -47,6 +47,8 @@ typedef struct pito_s {
|
||||||
int32_t airSpeed;
|
int32_t airSpeed;
|
||||||
} pitot_t;
|
} pitot_t;
|
||||||
|
|
||||||
|
#ifdef USE_PITOT
|
||||||
|
|
||||||
extern pitot_t pitot;
|
extern pitot_t pitot;
|
||||||
|
|
||||||
bool pitotInit(void);
|
bool pitotInit(void);
|
||||||
|
@ -55,3 +57,5 @@ void pitotStartCalibration(void);
|
||||||
uint32_t pitotUpdate(void);
|
uint32_t pitotUpdate(void);
|
||||||
int32_t pitotCalculateAirSpeed(void);
|
int32_t pitotCalculateAirSpeed(void);
|
||||||
bool pitotIsHealthy(void);
|
bool pitotIsHealthy(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue