1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

Merge pull request #2896 from betaflight/msp-displayport-cli-fix

CF/BF - Fix CLI being spammed with OSD MSP_DISPLAYPORT messages
This commit is contained in:
Martin Budden 2017-04-18 08:19:31 +01:00 committed by GitHub
commit f67838f1cf

View file

@ -44,9 +44,20 @@ PG_REGISTER(displayPortProfile_t, displayPortProfileMsp, PG_DISPLAY_PORT_MSP_CON
static displayPort_t mspDisplayPort;
#ifdef USE_CLI
extern uint8_t cliMode;
#endif
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(cmd, buf, len);
}