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

Touch ups

This commit is contained in:
jflyper 2016-10-20 23:49:24 +09:00
parent b2a682b2ea
commit 7f2ebbd2fa
6 changed files with 9 additions and 256 deletions

View file

@ -129,34 +129,6 @@ static mspPostProcessFnPtr mspSerialProcessReceivedCommand(mspPort_t *mspPort)
return mspPostProcessFn;
}
#ifdef USE_DPRINTF
#include "common/printf.h"
#define DPRINTF_SERIAL_PORT SERIAL_PORT_USART3
extern serialPort_t *debugSerialPort;
#define dprintf(x) if (debugSerialPort) printf x
#else
#define dprintf(x)
#endif
void mspSerialPush(int cmd, uint8_t *data, int buflen)
{
for (uint8_t portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
mspPort_t * const mspPort = &mspPorts[portIndex];
if (!mspPort->port) {
continue;
}
// Big enough for a OSD line
uint8_t buf[sizeof(bufWriter_t) + 30];
writer = bufWriterInit(buf, sizeof(buf), (bufWrite_t)serialWriteBufShim, mspPort->port);
mspServerPush(mspPort, cmd, data, buflen);
bufWriterFlush(writer);
}
}
/*
* Process MSP commands from serial ports configured as MSP ports.
*