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

[MSP] Correctly report the configured and active OSD type

- Tell the OSD driver the type of displayPort, so it can be retrieved
later.
- Use OSD driver code instead of device specific code to handle
MSP_OSD_CONFIG response while minimizing driver specific code.
- Add flag for signaling the use of FrSky OSD (bit 3).
- Rename OSD_FLAGS_MAX7456_DETECTED to OSD_FLAGS_OSD_DEVICE_DETECTED.
Since we only support one OSD device type at a time, we can use the
same bit to signal wether the hardware has been detected.
This commit is contained in:
Alberto García Hierro 2020-01-03 16:20:23 +00:00
parent 6433aaa688
commit 65f84f2c86
7 changed files with 49 additions and 19 deletions

View file

@ -921,6 +921,7 @@ void init(void)
#if (defined(USE_OSD) || (defined(USE_MSP_DISPLAYPORT) && defined(USE_CMS)))
displayPort_t *osdDisplayPort = NULL;
osdDisplayPortDevice_e osdDisplayPortDevice = OSD_DISPLAYPORT_DEVICE_NONE;
#endif
#if defined(USE_OSD)
@ -941,6 +942,7 @@ void init(void)
case OSD_DISPLAYPORT_DEVICE_FRSKYOSD:
osdDisplayPort = frskyOsdDisplayPortInit(vcdProfile()->video_system);
if (osdDisplayPort || device == OSD_DISPLAYPORT_DEVICE_FRSKYOSD) {
osdDisplayPortDevice = OSD_DISPLAYPORT_DEVICE_FRSKYOSD;
break;
}
FALLTHROUGH;
@ -951,6 +953,7 @@ void init(void)
// If there is a max7456 chip for the OSD configured and detectd then use it.
osdDisplayPort = max7456DisplayPortInit(vcdProfile());
if (osdDisplayPort || device == OSD_DISPLAYPORT_DEVICE_MAX7456) {
osdDisplayPortDevice = OSD_DISPLAYPORT_DEVICE_MAX7456;
break;
}
FALLTHROUGH;
@ -960,6 +963,7 @@ void init(void)
case OSD_DISPLAYPORT_DEVICE_MSP:
osdDisplayPort = displayPortMspInit();
if (osdDisplayPort || device == OSD_DISPLAYPORT_DEVICE_MSP) {
osdDisplayPortDevice = OSD_DISPLAYPORT_DEVICE_MSP;
break;
}
FALLTHROUGH;
@ -973,7 +977,7 @@ void init(void)
}
// osdInit will register with CMS by itself.
osdInit(osdDisplayPort);
osdInit(osdDisplayPort, osdDisplayPortDevice);
}
#endif // USE_OSD