mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Fix arm/disarm/arm bug when using shared msp/telemetry ports.
All msp ports are now re-initialised when disarming.
Bug wa introduced by c06fd78b83
- see
#144.
Runtime serial port scenario should not have been erased.
Fixes #144 and #155. Cleanup #125.
This commit is contained in:
parent
2d7184b25b
commit
db36cfe12e
6 changed files with 21 additions and 7 deletions
|
@ -59,8 +59,9 @@
|
|||
#include "io/gimbal.h"
|
||||
#include "io/gps.h"
|
||||
#include "io/ledstrip.h"
|
||||
#include "io/serial_cli.h"
|
||||
#include "io/serial.h"
|
||||
#include "io/serial_cli.h"
|
||||
#include "io/serial_msp.h"
|
||||
#include "io/statusindicator.h"
|
||||
#include "rx/msp.h"
|
||||
#include "telemetry/telemetry.h"
|
||||
|
@ -294,8 +295,17 @@ void annexCode(void)
|
|||
|
||||
void mwDisarm(void)
|
||||
{
|
||||
if (ARMING_FLAG(ARMED))
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
DISABLE_ARMING_FLAG(ARMED);
|
||||
|
||||
#ifdef TELEMETRY
|
||||
// the telemetry state must be checked immediately so that shared serial ports are released.
|
||||
checkTelemetryState();
|
||||
if (isSerialPortFunctionShared(FUNCTION_TELEMETRY, FUNCTION_MSP)) {
|
||||
mspReset(&masterConfig.serialConfig);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void mwArm(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue