From 6ea05b93ab7286d3d19f14bcd3aba571acb9c10b Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Fri, 9 Jun 2017 12:46:34 +0100 Subject: [PATCH] Add setting of MAX7456 image options --- src/main/drivers/display.h | 3 +++ src/main/fc/settings.c | 3 +++ src/main/io/displayport_max7456.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/src/main/drivers/display.h b/src/main/drivers/display.h index cadf31f615..1cecb77ca7 100644 --- a/src/main/drivers/display.h +++ b/src/main/drivers/display.h @@ -46,6 +46,9 @@ typedef struct displayPortVTable_s { typedef struct displayPortProfile_s { int8_t colAdjust; int8_t rowAdjust; + bool invert; + uint8_t blackBrightness; + uint8_t whiteBrightness; } displayPortProfile_t; void displayGrab(displayPort_t *instance); diff --git a/src/main/fc/settings.c b/src/main/fc/settings.c index a1cfb2d0ed..d1542a23d6 100644 --- a/src/main/fc/settings.c +++ b/src/main/fc/settings.c @@ -700,6 +700,9 @@ const clivalue_t valueTable[] = { #ifdef USE_MAX7456 { "displayport_max7456_col_adjust", VAR_INT8| MASTER_VALUE, .config.minmax = { -6, 0 }, PG_DISPLAY_PORT_MAX7456_CONFIG, offsetof(displayPortProfile_t, colAdjust) }, { "displayport_max7456_row_adjust", VAR_INT8| MASTER_VALUE, .config.minmax = { -3, 0 }, PG_DISPLAY_PORT_MAX7456_CONFIG, offsetof(displayPortProfile_t, rowAdjust) }, + { "displayport_max7456_inv", VAR_UINT8| MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_DISPLAY_PORT_MAX7456_CONFIG, offsetof(displayPortProfile_t, invert) }, + { "displayport_max7456_blk", VAR_UINT8| MASTER_VALUE, .config.minmax = { 0, 3 }, PG_DISPLAY_PORT_MAX7456_CONFIG, offsetof(displayPortProfile_t, blackBrightness) }, + { "displayport_max7456_wht", VAR_UINT8| MASTER_VALUE, .config.minmax = { 0, 3 }, PG_DISPLAY_PORT_MAX7456_CONFIG, offsetof(displayPortProfile_t, whiteBrightness) }, #endif #ifdef USE_ESC_SENSOR diff --git a/src/main/io/displayport_max7456.c b/src/main/io/displayport_max7456.c index a62eff6031..895169807c 100644 --- a/src/main/io/displayport_max7456.c +++ b/src/main/io/displayport_max7456.c @@ -62,6 +62,10 @@ static int release(displayPort_t *displayPort) static int clearScreen(displayPort_t *displayPort) { UNUSED(displayPort); + + max7456Invert(displayPortProfileMax7456()->invert); + max7456Brightness(displayPortProfileMax7456()->blackBrightness, displayPortProfileMax7456()->whiteBrightness); + max7456ClearScreen(); return 0;