1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 07:45:29 +03:00

New stack for OSD with full menus for PIDs etc.

There is a lot of changes and fixes in driver also
This commit is contained in:
Marcin Baliniak 2016-09-18 21:27:09 +02:00
parent 9a5e53d8ae
commit 1e2a961bcd
6 changed files with 1919 additions and 925 deletions

14
src/main/io/serial_msp.c Normal file → Executable file
View file

@ -526,7 +526,7 @@ void mspInit(serialConfig_t *serialConfig)
#endif
activeBoxIds[activeBoxIdCount++] = BOXFPVANGLEMIX;
if (feature(FEATURE_3D)) {
activeBoxIds[activeBoxIdCount++] = BOX3DDISABLESWITCH;
}
@ -538,11 +538,11 @@ void mspInit(serialConfig_t *serialConfig)
if (feature(FEATURE_INFLIGHT_ACC_CAL)) {
activeBoxIds[activeBoxIdCount++] = BOXCALIB;
}
if (feature(FEATURE_OSD)) {
activeBoxIds[activeBoxIdCount++] = BOXOSD;
}
#ifdef TELEMETRY
if (feature(FEATURE_TELEMETRY) && masterConfig.telemetryConfig.telemetry_switch) {
activeBoxIds[activeBoxIdCount++] = BOXTELEMETRY;
@ -1197,10 +1197,14 @@ static bool processOutCommand(uint8_t cmdMSP)
case MSP_OSD_CONFIG:
#ifdef OSD
headSerialReply(2 + (OSD_MAX_ITEMS * 2));
headSerialReply(7 + (OSD_MAX_ITEMS * 2));
serialize8(1); // OSD supported
// send video system (AUTO/PAL/NTSC)
serialize8(masterConfig.osdProfile.video_system);
serialize8(masterConfig.osdProfile.rssi_alarm);
serialize16(masterConfig.osdProfile.cap_alarm);
serialize16(masterConfig.osdProfile.time_alarm);
for (i = 0; i < OSD_MAX_ITEMS; i++) {
serialize16(masterConfig.osdProfile.item_pos[i]);
}
@ -1879,7 +1883,7 @@ static bool processInCommand(void)
masterConfig.baro_hardware = read8();
masterConfig.mag_hardware = read8();
break;
case MSP_SET_NAME:
memset(masterConfig.name, 0, ARRAYLEN(masterConfig.name));
for (i = 0; i < MIN(MAX_NAME_LENGTH, currentPort->dataSize); i++) {