mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
reverted unrelated changes
This commit is contained in:
parent
c36154172e
commit
42a8ce15c1
9 changed files with 15 additions and 42 deletions
|
@ -607,7 +607,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
|||
break;
|
||||
|
||||
case MSP_ALTITUDE:
|
||||
sbufWriteU32(dst, lrintf(getEstimatedActualPosition(Z)));
|
||||
sbufWriteU32(dst, lrintf(getEstimatedActualPosition(Z)));
|
||||
sbufWriteU16(dst, lrintf(getEstimatedActualVelocity(Z)));
|
||||
#if defined(USE_BARO)
|
||||
sbufWriteU32(dst, baroGetLatestAltitude());
|
||||
|
@ -2478,7 +2478,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
#ifdef USE_GPS
|
||||
case MSP_SET_RAW_GPS:
|
||||
if (dataSize == 14) {
|
||||
if (sbufReadU8(src)) {
|
||||
if (sbufReadU8(src)) {
|
||||
ENABLE_STATE(GPS_FIX);
|
||||
} else {
|
||||
DISABLE_STATE(GPS_FIX);
|
||||
|
@ -3395,31 +3395,6 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
*ret = mspFcSafeHomeOutCommand(dst, src);
|
||||
break;
|
||||
|
||||
case MSP_TELEMETRY:
|
||||
sbufWriteU8(dst, ARMING_FLAG(ARMED)); // arming status
|
||||
sbufWriteU8(dst, 0); // modes
|
||||
sbufWriteU32(dst, flightModeFlags);
|
||||
|
||||
sbufWriteU8(dst, 1); // messages
|
||||
char buff[50] = {" "};
|
||||
osdGetSystemMessage(buff, sizeof(buff), false);
|
||||
const char *c = buff;
|
||||
while (*c) {
|
||||
sbufWriteU8(dst, *c++);
|
||||
}
|
||||
sbufWriteU8(dst, '\0'); // last symbol
|
||||
|
||||
sbufWriteU8(dst, 2); // home position
|
||||
sbufWriteU16(dst, GPS_distanceToHome);
|
||||
sbufWriteU16(dst, GPS_directionToHome);
|
||||
sbufWriteU32(dst, baro.BaroAlt);
|
||||
sbufWriteU8(dst, 3); // throttle
|
||||
sbufWriteU8(dst, getThrottlePercent());
|
||||
sbufWriteU8(dst, 4); // vario
|
||||
sbufWriteU16(dst, getEstimatedActualVelocity(Z) + 32000);
|
||||
|
||||
*ret = MSP_RESULT_ACK;
|
||||
break;
|
||||
#ifdef USE_SIMULATOR
|
||||
case MSP_SIMULATOR:
|
||||
tmp_u8 = sbufReadU8(src); //MSP_SIMULATOR version
|
||||
|
|
|
@ -328,9 +328,9 @@ static void imuMahonyAHRSupdate(float dt, const fpVector3_t * gyroBF, const fpVe
|
|||
vectorNormalize(&vMag, &vMag);
|
||||
|
||||
#ifdef USE_SIMULATOR
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
imuSetMagneticDeclination(0);
|
||||
}
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
imuSetMagneticDeclination(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reference mag field vector heading is Magnetic North in EF. We compute that by rotating True North vector by declination and assuming Z-component is zero
|
||||
|
|
|
@ -246,6 +246,7 @@ void writeServos(void)
|
|||
void servoMixer(float dT)
|
||||
{
|
||||
int16_t input[INPUT_SOURCE_COUNT]; // Range [-500:+500]
|
||||
|
||||
if (FLIGHT_MODE(MANUAL_MODE)) {
|
||||
input[INPUT_STABILIZED_ROLL] = rcCommand[ROLL];
|
||||
input[INPUT_STABILIZED_PITCH] = rcCommand[PITCH];
|
||||
|
|
|
@ -846,10 +846,8 @@ static const char * osdArmingDisabledReasonMessage(void)
|
|||
FALLTHROUGH;
|
||||
case ARMED:
|
||||
FALLTHROUGH;
|
||||
#ifdef USE_SIMULATOR
|
||||
case SIMULATOR_MODE:
|
||||
FALLTHROUGH;
|
||||
#endif
|
||||
case WAS_EVER_ARMED:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -537,10 +537,8 @@ static char * osdArmingDisabledReasonMessage(void)
|
|||
FALLTHROUGH;
|
||||
case ARMED:
|
||||
FALLTHROUGH;
|
||||
#ifdef USE_SIMULATOR
|
||||
case SIMULATOR_MODE:
|
||||
FALLTHROUGH;
|
||||
#endif
|
||||
case WAS_EVER_ARMED:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -505,8 +505,8 @@ void accUpdate(void)
|
|||
{
|
||||
#ifdef USE_SIMULATOR
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
//output: acc.accADCf
|
||||
//unused: acc.dev.ADCRaw[], acc.accClipCount, acc.accVibeSq[]
|
||||
//output: acc.accADCf
|
||||
//unused: acc.dev.ADCRaw[], acc.accClipCount, acc.accVibeSq[]
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -516,6 +516,7 @@ void accUpdate(void)
|
|||
|
||||
for (int axis = 0; axis < XYZ_AXIS_COUNT; axis++) {
|
||||
accADC[axis] = acc.dev.ADCRaw[axis];
|
||||
DEBUG_SET(DEBUG_ACC, axis, accADC[axis]);
|
||||
}
|
||||
|
||||
performAcclerationCalibration();
|
||||
|
|
|
@ -278,7 +278,7 @@ uint32_t baroUpdate(void)
|
|||
}
|
||||
#ifdef USE_SIMULATOR
|
||||
if (!ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
//output: baro.baroPressure, baro.baroTemperature
|
||||
//output: baro.baroPressure, baro.baroTemperature
|
||||
baro.dev.calculate(&baro.dev, &baro.baroPressure, &baro.baroTemperature);
|
||||
}
|
||||
#else
|
||||
|
@ -332,7 +332,7 @@ int32_t baroCalculateAltitude(void)
|
|||
}
|
||||
#endif
|
||||
// calculates height from ground via baro readings
|
||||
baro.BaroAlt = pressureToAltitude(baro.baroPressure) - baroGroundAltitude;
|
||||
baro.BaroAlt = pressureToAltitude(baro.baroPressure) - baroGroundAltitude;
|
||||
}
|
||||
|
||||
return baro.BaroAlt;
|
||||
|
|
|
@ -501,8 +501,8 @@ void FAST_CODE NOINLINE gyroUpdate()
|
|||
{
|
||||
#ifdef USE_SIMULATOR
|
||||
if (ARMING_FLAG(SIMULATOR_MODE)) {
|
||||
//output: gyro.gyroADCf[axis]
|
||||
//unused: dev->gyroADCRaw[], dev->gyroZero[];
|
||||
//output: gyro.gyroADCf[axis]
|
||||
//unused: dev->gyroADCRaw[], dev->gyroZero[];
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -184,6 +184,8 @@
|
|||
// Wind estimator
|
||||
#define USE_WIND_ESTIMATOR
|
||||
|
||||
#define USE_SIMULATOR
|
||||
|
||||
//Designed to free space of F722 and F411 MCUs
|
||||
#if (MCU_FLASH_SIZE > 512)
|
||||
|
||||
|
@ -193,6 +195,4 @@
|
|||
#define USE_TELEMETRY_HOTT
|
||||
#define USE_HOTT_TEXTMODE
|
||||
|
||||
#define USE_SIMULATOR
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue