mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-22 07:45:29 +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:
parent
05418297b2
commit
3d7151c6c0
4 changed files with 29 additions and 0 deletions
|
@ -1428,6 +1428,10 @@ const clivalue_t valueTable[] = {
|
||||||
{ "displayport_msp_col_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -6, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, colAdjust) },
|
{ "displayport_msp_col_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -6, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, colAdjust) },
|
||||||
{ "displayport_msp_row_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -3, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, rowAdjust) },
|
{ "displayport_msp_row_adjust", VAR_INT8 | MASTER_VALUE, .config.minmax = { -3, 0 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, rowAdjust) },
|
||||||
{ "displayport_msp_serial", VAR_INT8 | MASTER_VALUE, .config.minmax = { SERIAL_PORT_NONE, SERIAL_PORT_IDENTIFIER_MAX }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, displayPortSerial) },
|
{ "displayport_msp_serial", VAR_INT8 | MASTER_VALUE, .config.minmax = { SERIAL_PORT_NONE, SERIAL_PORT_IDENTIFIER_MAX }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, displayPortSerial) },
|
||||||
|
#ifdef USE_DISPLAYPORT_MSP_VENDOR_SPECIFIC
|
||||||
|
{ "displayport_msp_vendor_init", VAR_UINT8 | MASTER_VALUE | MODE_ARRAY, .config.array.length = 253, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, vendorInit) },
|
||||||
|
{ "displayport_msp_vendor_init_length", VAR_UINT8 | MASTER_VALUE, .config.minmaxUnsigned = { 0, 252 }, PG_DISPLAY_PORT_MSP_CONFIG, offsetof(displayPortProfile_t, vendorInitLength) },
|
||||||
|
#endif // USE_DISPLAYPORT_MSP_VENDOR_SPECIFIC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PG_DISPLAY_PORT_MSP_CONFIG
|
// PG_DISPLAY_PORT_MSP_CONFIG
|
||||||
|
|
|
@ -170,6 +170,21 @@ static const displayPortVTable_t mspDisplayPortVTable = {
|
||||||
|
|
||||||
displayPort_t *displayPortMspInit(void)
|
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);
|
displayInit(&mspDisplayPort, &mspDisplayPortVTable);
|
||||||
resync(&mspDisplayPort);
|
resync(&mspDisplayPort);
|
||||||
return &mspDisplayPort;
|
return &mspDisplayPort;
|
||||||
|
|
|
@ -29,6 +29,11 @@ typedef struct displayPortProfile_s {
|
||||||
uint8_t blackBrightness;
|
uint8_t blackBrightness;
|
||||||
uint8_t whiteBrightness;
|
uint8_t whiteBrightness;
|
||||||
int8_t displayPortSerial; // serialPortIdentifier_e
|
int8_t displayPortSerial; // serialPortIdentifier_e
|
||||||
|
|
||||||
|
#ifdef USE_DISPLAYPORT_MSP_VENDOR_SPECIFIC
|
||||||
|
uint8_t vendorInitLength; // Actual length of vendorInit byte string
|
||||||
|
uint8_t vendorInit[253]; // Max 253 bytes of vendor specific initialization byte string
|
||||||
|
#endif
|
||||||
} displayPortProfile_t;
|
} displayPortProfile_t;
|
||||||
|
|
||||||
PG_DECLARE(displayPortProfile_t, displayPortProfileMsp);
|
PG_DECLARE(displayPortProfile_t, displayPortProfileMsp);
|
||||||
|
|
|
@ -677,3 +677,8 @@
|
||||||
#define DSHOT_BITBANGED_TIMER_DEFAULT DSHOT_BITBANGED_TIMER_AUTO
|
#define DSHOT_BITBANGED_TIMER_DEFAULT DSHOT_BITBANGED_TIMER_AUTO
|
||||||
#endif
|
#endif
|
||||||
#endif // USE_DSHOT_BITBANG
|
#endif // USE_DSHOT_BITBANG
|
||||||
|
|
||||||
|
// XXX Tentative; may be removed
|
||||||
|
#if defined(USE_MSP_DISPLAYPORT) && defined(USE_OSD_OVER_MSP_DISPLAYPORT)
|
||||||
|
#define USE_DISPLAYPORT_MSP_VENDOR_SPECIFIC
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue