diff --git a/src/main/drivers/max7456.c b/src/main/drivers/max7456.c index 743653b8c0..3e4d541d87 100755 --- a/src/main/drivers/max7456.c +++ b/src/main/drivers/max7456.c @@ -378,7 +378,7 @@ void max7456ReInit(void) //here we init only CS and try to init MAX for first time -void max7456Init(vcdProfile_t *pVcdProfile) +void max7456Init(const vcdProfile_t *pVcdProfile) { #ifdef MAX7456_SPI_CS_PIN max7456CsPin = IOGetByTag(IO_TAG(MAX7456_SPI_CS_PIN)); diff --git a/src/main/drivers/max7456.h b/src/main/drivers/max7456.h index c089c71a37..6c91f58ab8 100755 --- a/src/main/drivers/max7456.h +++ b/src/main/drivers/max7456.h @@ -34,7 +34,7 @@ extern uint16_t maxScreenSize; -void max7456Init(vcdProfile_t *vcdProfile); +void max7456Init(const vcdProfile_t *vcdProfile); void max7456DrawScreen(void); void max7456WriteNvm(uint8_t char_address, const uint8_t *font_data); uint8_t max7456GetRowsCount(void); diff --git a/src/main/io/displayport_max7456.c b/src/main/io/displayport_max7456.c index 9435edc1c1..a241136aca 100644 --- a/src/main/io/displayport_max7456.c +++ b/src/main/io/displayport_max7456.c @@ -131,10 +131,10 @@ static const displayPortVTable_t max7456VTable = { .txBytesFree = txBytesFree, }; -displayPort_t *max7456DisplayPortInit(uint8_t system) +displayPort_t *max7456DisplayPortInit(const vcdProfile_t *vcdProfile) { displayInit(&max7456DisplayPort, &max7456VTable); - max7456Init(system); + max7456Init(vcdProfile); resync(&max7456DisplayPort); return &max7456DisplayPort; } diff --git a/src/main/io/displayport_max7456.h b/src/main/io/displayport_max7456.h index e94ffd9106..2e8b6266b0 100644 --- a/src/main/io/displayport_max7456.h +++ b/src/main/io/displayport_max7456.h @@ -17,4 +17,5 @@ #pragma once -displayPort_t *max7456DisplayPortInit(uint8_t videoSystem); +struct vcdProfile_s; +displayPort_t *max7456DisplayPortInit(const struct vcdProfile_s *vcdProfile); diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 19ddbc00e0..d3a7111af8 100755 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -419,11 +419,6 @@ void osdInit(displayPort_t *osdDisplayPortToUse) armState = ARMING_FLAG(ARMED); - // This will eventually go away when moving to a full displayPort - // oriented implementation, or replaced with hal. - - max7456Init(&masterConfig.vcdProfile); - displayClearScreen(osdDisplayPort); // display logo and help diff --git a/src/main/main.c b/src/main/main.c index 75e5fbcd2b..f57575873e 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -409,7 +409,7 @@ void init(void) if (feature(FEATURE_OSD)) { #ifdef USE_MAX7456 // if there is a max7456 chip for the OSD then use it, otherwise use MSP - displayPort_t *osdDisplayPort = max7456DisplayPortInit(masterConfig.osdProfile.video_system); + displayPort_t *osdDisplayPort = max7456DisplayPortInit(&masterConfig.vcdProfile); #else displayPort_t *osdDisplayPort = displayPortMspInit(); #endif diff --git a/src/test/unit/cms_unittest.cc b/src/test/unit/cms_unittest.cc index cb52176cff..6c8e1c79b3 100644 --- a/src/test/unit/cms_unittest.cc +++ b/src/test/unit/cms_unittest.cc @@ -96,10 +96,9 @@ static const displayPortVTable_t testDisplayPortVTable = { displayPort_t *displayPortTestInit(void) { - testDisplayPort.vTable = &testDisplayPortVTable; + displayInit(&testDisplayPort, &testDisplayPortVTable); testDisplayPort.rows = 10; testDisplayPort.cols = 40; - testDisplayPort.isGrabbed = false; return &testDisplayPort; }