1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

Improved OSD & displayPort initialisation. Allowed nested screen grabbing

This commit is contained in:
Martin Budden 2016-11-16 14:27:59 +00:00
parent 9a62b04699
commit 7c8d1967d0
9 changed files with 153 additions and 124 deletions

View file

@ -42,16 +42,17 @@ static int output(displayPort_t *displayPort, uint8_t cmd, const uint8_t *buf, i
return mspSerialPush(cmd, buf, len);
}
static int grab(displayPort_t *displayPort)
static int heartbeat(displayPort_t *displayPort)
{
const uint8_t subcmd[] = { 0 };
// ensure display is not released by MW OSD software
return output(displayPort, MSP_DISPLAYPORT, subcmd, sizeof(subcmd));
}
static int heartbeat(displayPort_t *displayPort)
static int grab(displayPort_t *displayPort)
{
return grab(displayPort); // ensure display is not released by MW OSD software
return heartbeat(displayPort);
}
static int release(displayPort_t *displayPort)
@ -141,8 +142,7 @@ static const displayPortVTable_t mspDisplayPortVTable = {
displayPort_t *displayPortMspInit(void)
{
mspDisplayPort.vTable = &mspDisplayPortVTable;
mspDisplayPort.isGrabbed = false;
displayInit(&mspDisplayPort, &mspDisplayPortVTable);
resync(&mspDisplayPort);
return &mspDisplayPort;
}