mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 17:55:30 +03:00
Telemetry switch enable without arming bugfix
This commit is contained in:
parent
3037a91b06
commit
e033dc1156
1 changed files with 18 additions and 20 deletions
|
@ -318,14 +318,6 @@ void mwDisarm(void)
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
DISABLE_ARMING_FLAG(ARMED);
|
DISABLE_ARMING_FLAG(ARMED);
|
||||||
|
|
||||||
#ifdef TELEMETRY
|
|
||||||
if (feature(FEATURE_TELEMETRY)) {
|
|
||||||
// the telemetry state must be checked immediately so that shared serial ports are released.
|
|
||||||
checkTelemetryState();
|
|
||||||
mspAllocateSerialPorts(&masterConfig.serialConfig);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BLACKBOX
|
#ifdef BLACKBOX
|
||||||
if (feature(FEATURE_BLACKBOX)) {
|
if (feature(FEATURE_BLACKBOX)) {
|
||||||
finishBlackbox();
|
finishBlackbox();
|
||||||
|
@ -348,18 +340,6 @@ void mwArm(void)
|
||||||
ENABLE_ARMING_FLAG(ARMED);
|
ENABLE_ARMING_FLAG(ARMED);
|
||||||
headFreeModeHold = heading;
|
headFreeModeHold = heading;
|
||||||
|
|
||||||
#ifdef TELEMETRY
|
|
||||||
if (feature(FEATURE_TELEMETRY)) {
|
|
||||||
|
|
||||||
|
|
||||||
serialPort_t *sharedPort = findSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
|
||||||
while (sharedPort) {
|
|
||||||
mspReleasePortIfAllocated(sharedPort);
|
|
||||||
sharedPort = findNextSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef BLACKBOX
|
#ifdef BLACKBOX
|
||||||
if (feature(FEATURE_BLACKBOX)) {
|
if (feature(FEATURE_BLACKBOX)) {
|
||||||
serialPort_t *sharedBlackboxAndMspPort = findSharedSerialPort(FUNCTION_BLACKBOX, FUNCTION_MSP);
|
serialPort_t *sharedBlackboxAndMspPort = findSharedSerialPort(FUNCTION_BLACKBOX, FUNCTION_MSP);
|
||||||
|
@ -678,6 +658,24 @@ void processRx(void)
|
||||||
if (masterConfig.mixerMode == MIXER_FLYING_WING || masterConfig.mixerMode == MIXER_AIRPLANE) {
|
if (masterConfig.mixerMode == MIXER_FLYING_WING || masterConfig.mixerMode == MIXER_AIRPLANE) {
|
||||||
DISABLE_FLIGHT_MODE(HEADFREE_MODE);
|
DISABLE_FLIGHT_MODE(HEADFREE_MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TELEMETRY
|
||||||
|
if (feature(FEATURE_TELEMETRY)) {
|
||||||
|
if ((!masterConfig.telemetryConfig.telemetry_switch && ARMING_FLAG(ARMED)) ||
|
||||||
|
(masterConfig.telemetryConfig.telemetry_switch && IS_RC_MODE_ACTIVE(BOXTELEMETRY))) {
|
||||||
|
serialPort_t *sharedPort = findSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
||||||
|
while (sharedPort) {
|
||||||
|
mspReleasePortIfAllocated(sharedPort);
|
||||||
|
sharedPort = findNextSharedSerialPort(TELEMETRY_FUNCTION_MASK, FUNCTION_MSP);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// the telemetry state must be checked immediately so that shared serial ports are released.
|
||||||
|
checkTelemetryState();
|
||||||
|
mspAllocateSerialPorts(&masterConfig.serialConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void)
|
void loop(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue