mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-24 00:35:34 +03:00
Merge branch 'master' of https://github.com/RomanLut/inav into submit-gps-fix-estimation
This commit is contained in:
commit
2b9a5a6a8d
178 changed files with 5846 additions and 2036 deletions
|
@ -2482,12 +2482,24 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
if (newFrequency <= VTXCOMMON_MSP_BANDCHAN_CHKVAL) { //value is band and channel
|
||||
const uint8_t newBand = (newFrequency / 8) + 1;
|
||||
const uint8_t newChannel = (newFrequency % 8) + 1;
|
||||
|
||||
if(vtxSettingsConfig()->band != newBand || vtxSettingsConfig()->channel != newChannel) {
|
||||
vtxCommonSetBandAndChannel(vtxDevice, newBand, newChannel);
|
||||
}
|
||||
|
||||
vtxSettingsConfigMutable()->band = newBand;
|
||||
vtxSettingsConfigMutable()->channel = newChannel;
|
||||
}
|
||||
|
||||
if (sbufBytesRemaining(src) > 1) {
|
||||
vtxSettingsConfigMutable()->power = sbufReadU8(src);
|
||||
uint8_t newPower = sbufReadU8(src);
|
||||
uint8_t currentPower = 0;
|
||||
vtxCommonGetPowerIndex(vtxDevice, ¤tPower);
|
||||
if (newPower != currentPower) {
|
||||
vtxCommonSetPowerByIndex(vtxDevice, newPower);
|
||||
vtxSettingsConfigMutable()->power = newPower;
|
||||
}
|
||||
|
||||
// Delegate pitmode to vtx directly
|
||||
const uint8_t newPitmode = sbufReadU8(src);
|
||||
uint8_t currentPitmode = 0;
|
||||
|
@ -3484,7 +3496,9 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
DISABLE_ARMING_FLAG(SIMULATOR_MODE_HITL);
|
||||
|
||||
#ifdef USE_BARO
|
||||
if ( requestedSensors[SENSOR_INDEX_BARO] != BARO_NONE ) {
|
||||
baroStartCalibration();
|
||||
}
|
||||
#endif
|
||||
#ifdef USE_MAG
|
||||
DISABLE_STATE(COMPASS_CALIBRATED);
|
||||
|
@ -3495,10 +3509,15 @@ bool mspFCProcessInOutCommand(uint16_t cmdMSP, sbuf_t *dst, sbuf_t *src, mspResu
|
|||
|
||||
disarm(DISARM_SWITCH); // Disarm to prevent motor output!!!
|
||||
}
|
||||
} else if (!areSensorsCalibrating()) {
|
||||
} else {
|
||||
if (!ARMING_FLAG(SIMULATOR_MODE_HITL)) { // Just once
|
||||
#ifdef USE_BARO
|
||||
baroStartCalibration();
|
||||
if ( requestedSensors[SENSOR_INDEX_BARO] != BARO_NONE ) {
|
||||
sensorsSet(SENSOR_BARO);
|
||||
setTaskEnabled(TASK_BARO, true);
|
||||
DISABLE_ARMING_FLAG(ARMING_DISABLED_HARDWARE_FAILURE);
|
||||
baroStartCalibration();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue