1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 00:35:39 +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:
jflyper 2016-10-19 02:39:52 +09:00
parent 9b83af1ccd
commit 01eab00fd7
12 changed files with 1025 additions and 662 deletions

View file

@ -127,6 +127,14 @@ extern uint8_t motorControlEnable;
serialPort_t *loopbackPort;
#endif
#ifdef USE_DPRINTF
#include "common/printf.h"
#define DPRINTF_SERIAL_PORT SERIAL_PORT_USART3
serialPort_t *debugSerialPort = NULL;
#define dprintf(x) if (debugSerialPort) printf x
#else
#define dprintf(x)
#endif
typedef enum {
SYSTEM_STATE_INITIALISING = 0,
@ -245,6 +253,16 @@ void init(void)
serialInit(&masterConfig.serialConfig, feature(FEATURE_SOFTSERIAL), SERIAL_PORT_NONE);
#endif
#ifdef USE_DPRINTF
// Setup debugSerialPort
debugSerialPort = openSerialPort(DPRINTF_SERIAL_PORT, FUNCTION_NONE, NULL, 115200, MODE_RXTX, 0);
if (debugSerialPort) {
setPrintfSerialPort(debugSerialPort);
dprintf(("debugSerialPort: OK\r\n"));
}
#endif
mixerInit(masterConfig.mixerMode, masterConfig.customMotorMixer);
#ifdef USE_SERVOS
servoMixerInit(masterConfig.customServoMixer);