Abondon the extension bit, rely on API version for switching

This commit is contained in:
jflyper 2017-06-30 22:28:04 +09:00
parent b3a481e95a
commit ac0df42a05
1 changed files with 1 additions and 8 deletions

View File

@ -912,14 +912,7 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
#else
sbufWriteU16(dst, 0);
#endif
// Lower 5-bits (bits 0-4) are traditional sensor flags.
// If bit 5 is on, then bit 6 indicates gyro detection status.
uint16_t sensorBits = sensors(SENSOR_ACC) | sensors(SENSOR_BARO) << 1 | sensors(SENSOR_MAG) << 2 | sensors(SENSOR_GPS) << 3 | sensors(SENSOR_SONAR) << 4;
sensorBits |= (1 << 5); // Extention indicator bit
sensorBits |= sensors(SENSOR_GYRO) << 6;
sbufWriteU16(dst, sensorBits);
sbufWriteU16(dst, sensors(SENSOR_ACC) | sensors(SENSOR_BARO) << 1 | sensors(SENSOR_MAG) << 2 | sensors(SENSOR_GPS) << 3 | sensors(SENSOR_SONAR) << 4 | sensors(SENSOR_GYRO) << 5);
sbufWriteData(dst, &flightModeFlags, 4); // unconditional part of flags, first 32 bits
sbufWriteU8(dst, getCurrentPidProfileIndex());
sbufWriteU16(dst, constrain(averageSystemLoadPercent, 0, 100));