1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-25 17:25:18 +03:00

Move FAKE sensor defs

This commit is contained in:
Scavanger 2023-01-24 10:40:16 -03:00
parent 09a2e4bd51
commit 3f750f28bb
4 changed files with 13 additions and 6 deletions

View file

@ -3562,11 +3562,15 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
sbufAdvance(src, sizeof(uint16_t) * XYZ_AXIS_COUNT); sbufAdvance(src, sizeof(uint16_t) * XYZ_AXIS_COUNT);
} }
#if defined(USE_FAKE_BATT_SENSOR)
if (SIMULATOR_HAS_OPTION(HITL_EXT_BATTERY_VOLTAGE)) { if (SIMULATOR_HAS_OPTION(HITL_EXT_BATTERY_VOLTAGE)) {
fakeBattSensorSetVbat(sbufReadU8(src) * 10); fakeBattSensorSetVbat(sbufReadU8(src) * 10);
} else { } else {
#endif
fakeBattSensorSetVbat((uint16_t)(SIMULATOR_FULL_BATTERY * 10.0f)); fakeBattSensorSetVbat((uint16_t)(SIMULATOR_FULL_BATTERY * 10.0f));
#if defined(USE_FAKE_BATT_SENSOR)
} }
#endif
if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) { if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) {
simulatorData.airSpeed = sbufReadU16(src); simulatorData.airSpeed = sbufReadU16(src);

View file

@ -211,8 +211,10 @@ STATIC_PROTOTHREAD(pitotThread)
float airSpeed; float airSpeed;
if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) { if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) {
airSpeed = simulatorData.airSpeed; airSpeed = simulatorData.airSpeed;
#if defined(USE_PITOT_FAKE)
} else if (pitotmeterConfig()->pitot_hardware == PITOT_FAKE) { } else if (pitotmeterConfig()->pitot_hardware == PITOT_FAKE) {
airSpeed = fakePitotGetAirspeed(); airSpeed = fakePitotGetAirspeed();
#endif
} else { } else {
airSpeed = 0; airSpeed = 0;
} }
@ -244,8 +246,10 @@ STATIC_PROTOTHREAD(pitotThread)
#ifdef USE_SIMULATOR #ifdef USE_SIMULATOR
if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) { if (SIMULATOR_HAS_OPTION(HITL_AIRSPEED)) {
pitot.airSpeed = simulatorData.airSpeed; pitot.airSpeed = simulatorData.airSpeed;
#if defined(USE_PITOT_FAKE)
} else if (pitotmeterConfig()->pitot_hardware == PITOT_FAKE) { } else if (pitotmeterConfig()->pitot_hardware == PITOT_FAKE) {
pitot.airSpeed = fakePitotGetAirspeed(); pitot.airSpeed = fakePitotGetAirspeed();
#endif
} else { } else {
pitot.airSpeed = 0; pitot.airSpeed = 0;
} }

View file

@ -57,10 +57,14 @@
#define DEFAULT_RX_FEATURE FEATURE_RX_MSP #define DEFAULT_RX_FEATURE FEATURE_RX_MSP
#define DEFAULT_FEATURES (FEATURE_GPS | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT) #define DEFAULT_FEATURES (FEATURE_GPS | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT)
#define USE_IMU_FAKE
#define USE_ADC #define USE_ADC
#define USE_MAG #define USE_MAG
#define USE_BARO #define USE_BARO
#define USE_PITOT_FAKE
#define USE_IMU_FAKE
#define USE_FAKE_BARO
#define USE_FAKE_MAG
#define USE_GPS_FAKE
#undef USE_DASHBOARD #undef USE_DASHBOARD
#undef USE_TELEMETRY_LTM #undef USE_TELEMETRY_LTM

View file

@ -184,11 +184,6 @@
#define USE_SIMULATOR #define USE_SIMULATOR
#define USE_PITOT_VIRTUAL #define USE_PITOT_VIRTUAL
#define USE_FAKE_BATT_SENSOR #define USE_FAKE_BATT_SENSOR
#define USE_PITOT_FAKE
#define USE_IMU_FAKE
#define USE_FAKE_BARO
#define USE_FAKE_MAG
#define USE_GPS_FAKE
//Designed to free space of F722 and F411 MCUs //Designed to free space of F722 and F411 MCUs
#if (MCU_FLASH_SIZE > 512) #if (MCU_FLASH_SIZE > 512)