mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Don't handle non-MSP characters on VTX MSP port (#14091)
* Don't handle non-MSP characters on VTX MSP port * Remove check for CLI active on VTX MSP port as it can no longer be enabled * Only include check for MSP display port if USE_MSP_DISPLAYPORT is defined
This commit is contained in:
parent
5dc5a8e973
commit
b890220197
3 changed files with 12 additions and 7 deletions
|
@ -51,12 +51,6 @@ static int output(displayPort_t *displayPort, uint8_t cmd, uint8_t *buf, int len
|
||||||
{
|
{
|
||||||
UNUSED(displayPort);
|
UNUSED(displayPort);
|
||||||
|
|
||||||
#ifdef USE_CLI
|
|
||||||
// FIXME There should be no dependency on the CLI but mspSerialPush doesn't check for cli mode, and can't because it also shouldn't have a dependency on the CLI.
|
|
||||||
if (cliMode) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return mspSerialPush(displayPortSerial, cmd, buf, len, MSP_DIRECTION_REPLY, MSP_V1);
|
return mspSerialPush(displayPortSerial, cmd, buf, len, MSP_DIRECTION_REPLY, MSP_V1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,4 +223,8 @@ displayPort_t *displayPortMspInit(void)
|
||||||
void displayPortMspSetSerial(serialPortIdentifier_e serialPort) {
|
void displayPortMspSetSerial(serialPortIdentifier_e serialPort) {
|
||||||
displayPortSerial = serialPort;
|
displayPortSerial = serialPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
serialPortIdentifier_e displayPortMspGetSerial(void) {
|
||||||
|
return displayPortSerial;
|
||||||
|
}
|
||||||
#endif // USE_MSP_DISPLAYPORT
|
#endif // USE_MSP_DISPLAYPORT
|
||||||
|
|
|
@ -46,4 +46,5 @@ typedef enum {
|
||||||
|
|
||||||
struct displayPort_s *displayPortMspInit(void);
|
struct displayPort_s *displayPortMspInit(void);
|
||||||
void displayPortMspSetSerial(serialPortIdentifier_e serialPort);
|
void displayPortMspSetSerial(serialPortIdentifier_e serialPort);
|
||||||
|
serialPortIdentifier_e displayPortMspGetSerial(void);
|
||||||
|
|
||||||
|
|
|
@ -459,6 +459,7 @@ static void mspProcessPendingRequest(mspPort_t * mspPort)
|
||||||
case MSP_PENDING_CLI:
|
case MSP_PENDING_CLI:
|
||||||
mspPort->pendingRequest = MSP_PENDING_NONE;
|
mspPort->pendingRequest = MSP_PENDING_NONE;
|
||||||
mspPort->portState = PORT_CLI_ACTIVE;
|
mspPort->portState = PORT_CLI_ACTIVE;
|
||||||
|
|
||||||
cliEnter(mspPort->port, true);
|
cliEnter(mspPort->port, true);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -537,7 +538,12 @@ void mspSerialProcess(mspEvaluateNonMspData_e evaluateNonMspData, mspProcessComm
|
||||||
if (c == '$') {
|
if (c == '$') {
|
||||||
mspPort->portState = PORT_MSP_PACKET;
|
mspPort->portState = PORT_MSP_PACKET;
|
||||||
mspPort->packetState = MSP_HEADER_START;
|
mspPort->packetState = MSP_HEADER_START;
|
||||||
} else if (evaluateNonMspData == MSP_EVALUATE_NON_MSP_DATA) {
|
} else if ((evaluateNonMspData == MSP_EVALUATE_NON_MSP_DATA)
|
||||||
|
#ifdef USE_MSP_DISPLAYPORT
|
||||||
|
// Don't evaluate non-MSP commands on VTX MSP port
|
||||||
|
&& (mspPort->port->identifier != displayPortMspGetSerial())
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
// evaluate the non-MSP data
|
// evaluate the non-MSP data
|
||||||
if (c == serialConfig()->reboot_character) {
|
if (c == serialConfig()->reboot_character) {
|
||||||
mspPort->pendingRequest = MSP_PENDING_BOOTLOADER_ROM;
|
mspPort->pendingRequest = MSP_PENDING_BOOTLOADER_ROM;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue