1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +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:
Steve Evans 2024-12-18 22:37:18 +00:00 committed by GitHub
parent 5dc5a8e973
commit b890220197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 7 deletions

View file

@ -51,12 +51,6 @@ static int output(displayPort_t *displayPort, uint8_t cmd, uint8_t *buf, int len
{
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);
}
@ -229,4 +223,8 @@ displayPort_t *displayPortMspInit(void)
void displayPortMspSetSerial(serialPortIdentifier_e serialPort) {
displayPortSerial = serialPort;
}
serialPortIdentifier_e displayPortMspGetSerial(void) {
return displayPortSerial;
}
#endif // USE_MSP_DISPLAYPORT

View file

@ -46,4 +46,5 @@ typedef enum {
struct displayPort_s *displayPortMspInit(void);
void displayPortMspSetSerial(serialPortIdentifier_e serialPort);
serialPortIdentifier_e displayPortMspGetSerial(void);

View file

@ -459,6 +459,7 @@ static void mspProcessPendingRequest(mspPort_t * mspPort)
case MSP_PENDING_CLI:
mspPort->pendingRequest = MSP_PENDING_NONE;
mspPort->portState = PORT_CLI_ACTIVE;
cliEnter(mspPort->port, true);
break;
#endif
@ -537,7 +538,12 @@ void mspSerialProcess(mspEvaluateNonMspData_e evaluateNonMspData, mspProcessComm
if (c == '$') {
mspPort->portState = PORT_MSP_PACKET;
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
if (c == serialConfig()->reboot_character) {
mspPort->pendingRequest = MSP_PENDING_BOOTLOADER_ROM;