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

Add temporary facility of vendor specific init string to displayport msp

Only for debugging purposes during attribute rich displayport devices.
Should be / Will be removed from a production firmware.
This commit is contained in:
jflyper 2019-11-23 17:57:14 +09:00
parent 05418297b2
commit 3d7151c6c0
4 changed files with 29 additions and 0 deletions

View file

@ -170,6 +170,21 @@ static const displayPortVTable_t mspDisplayPortVTable = {
displayPort_t *displayPortMspInit(void)
{
#ifdef USE_DISPLAYPORT_MSP_VENDOR_SPECIFIC
// XXX Should handle the case that a device starts to listen after the init string is sent
// XXX 1. Send the init string periodically while not armed.
// XXX 2. Send the init string in response to device identification message from a device.
// Send vendor specific initialization string.
// The string start with subcommand code.
int initLength = displayPortProfileMsp()->vendorInitLength;
if (initLength) {
output(&mspDisplayPort, MSP_DISPLAYPORT, (uint8_t *)displayPortProfileMsp()->vendorInit, initLength);
}
#endif
displayInit(&mspDisplayPort, &mspDisplayPortVTable);
resync(&mspDisplayPort);
return &mspDisplayPort;