Make CMS OSD menu max7456 settings have realtime effect
Makes the invert, black brightness, and white brightness update the display as the settings are changed rather than only taking effect once the menu is exited.
This commit is contained in:
parent
18c485707e
commit
65aac98c1f
|
@ -952,6 +952,9 @@ STATIC_UNIT_TESTED uint16_t cmsHandleKey(displayPort_t *pDisplay, cms_key_e key)
|
||||||
if ((p->flags & REBOOT_REQUIRED) && (*val != previousValue)) {
|
if ((p->flags & REBOOT_REQUIRED) && (*val != previousValue)) {
|
||||||
setRebootRequired();
|
setRebootRequired();
|
||||||
}
|
}
|
||||||
|
if (p->func) {
|
||||||
|
p->func(pDisplay, p->data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -314,14 +314,23 @@ static const void *cmsx_menuOsdOnExit(const OSD_Entry *self)
|
||||||
changeOsdProfileIndex(osdConfig_osdProfileIndex);
|
changeOsdProfileIndex(osdConfig_osdProfileIndex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_MAX7456
|
#ifdef USE_MAX7456
|
||||||
|
static const void *cmsx_max7456Update(displayPort_t *pDisp, const void *self)
|
||||||
|
{
|
||||||
|
UNUSED(self);
|
||||||
|
|
||||||
displayPortProfileMax7456Mutable()->invert = displayPortProfileMax7456_invert;
|
displayPortProfileMax7456Mutable()->invert = displayPortProfileMax7456_invert;
|
||||||
displayPortProfileMax7456Mutable()->blackBrightness = displayPortProfileMax7456_blackBrightness;
|
displayPortProfileMax7456Mutable()->blackBrightness = displayPortProfileMax7456_blackBrightness;
|
||||||
displayPortProfileMax7456Mutable()->whiteBrightness = displayPortProfileMax7456_whiteBrightness;
|
displayPortProfileMax7456Mutable()->whiteBrightness = displayPortProfileMax7456_whiteBrightness;
|
||||||
#endif
|
|
||||||
|
displayClearScreen(pDisp);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif // USE_MAX7456
|
||||||
|
|
||||||
const OSD_Entry cmsx_menuOsdEntries[] =
|
const OSD_Entry cmsx_menuOsdEntries[] =
|
||||||
{
|
{
|
||||||
|
@ -335,9 +344,9 @@ const OSD_Entry cmsx_menuOsdEntries[] =
|
||||||
{"ALARMS", OME_Submenu, cmsMenuChange, &menuAlarms, 0},
|
{"ALARMS", OME_Submenu, cmsMenuChange, &menuAlarms, 0},
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_MAX7456
|
#ifdef USE_MAX7456
|
||||||
{"INVERT", OME_Bool, NULL, &displayPortProfileMax7456_invert, 0},
|
{"INVERT", OME_Bool, cmsx_max7456Update, &displayPortProfileMax7456_invert, 0},
|
||||||
{"BRT BLACK", OME_UINT8, NULL, &(OSD_UINT8_t){&displayPortProfileMax7456_blackBrightness, 0, 3, 1}, 0},
|
{"BRT BLACK", OME_UINT8, cmsx_max7456Update, &(OSD_UINT8_t){&displayPortProfileMax7456_blackBrightness, 0, 3, 1}, 0},
|
||||||
{"BRT WHITE", OME_UINT8, NULL, &(OSD_UINT8_t){&displayPortProfileMax7456_whiteBrightness, 0, 3, 1}, 0},
|
{"BRT WHITE", OME_UINT8, cmsx_max7456Update, &(OSD_UINT8_t){&displayPortProfileMax7456_whiteBrightness, 0, 3, 1}, 0},
|
||||||
#endif
|
#endif
|
||||||
{"BACK", OME_Back, NULL, NULL, 0},
|
{"BACK", OME_Back, NULL, NULL, 0},
|
||||||
{NULL, OME_END, NULL, NULL, 0}
|
{NULL, OME_END, NULL, NULL, 0}
|
||||||
|
|
Loading…
Reference in New Issue