mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Configuration Menu System support for external OSD
A quick hack to support config menu on external OSD, consisiting of: - CMS-OSD partial separation (CMS and OSD reside in a same file: osd.c) - MSP message injection (take it as server-push in client-server model)
This commit is contained in:
parent
9b83af1ccd
commit
01eab00fd7
12 changed files with 1025 additions and 662 deletions
|
@ -102,6 +102,15 @@
|
|||
#include "config/config_master.h"
|
||||
#include "config/feature.h"
|
||||
|
||||
#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
|
||||
|
||||
#ifdef USE_HARDWARE_REVISION_DETECTION
|
||||
#include "hardware_revision.h"
|
||||
#endif
|
||||
|
@ -1945,3 +1954,17 @@ mspProcessCommandFnPtr mspFcInit(void)
|
|||
initActiveBoxIds();
|
||||
return mspFcProcessCommand;
|
||||
}
|
||||
|
||||
void mspServerPush(mspPort_t *mspPort, int cmd, uint8_t *data, int len)
|
||||
{
|
||||
currentPort = mspPort;
|
||||
mspPort->cmdMSP = cmd;
|
||||
|
||||
headSerialReply(len);
|
||||
|
||||
while (len--) {
|
||||
serialize8(*data++);
|
||||
}
|
||||
|
||||
tailSerialReply();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue