1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Add OME_Funcall to call a function.

With the introduction of the CME_Menu, OME_Submenu became unsuitable
for general function calls. Actually, it works and call the designated
function, but attempt to externally traverse the menu structure fail
because it expects CME_Menu * as data for OME_Submenu.
This commit is contained in:
jflyper 2016-11-08 05:27:09 +09:00
parent c12942ed41
commit 576ad19914
3 changed files with 4 additions and 1 deletions

View file

@ -246,6 +246,7 @@ static int cmsDrawMenuEntry(displayPort_t *pDisplay, OSD_Entry *p, uint8_t row)
}
break;
case OME_Submenu:
case OME_Funcall:
if (IS_PRINTVALUE(p)) {
cnt = displayWrite(pDisplay, RIGHT_MENU_COLUMN(pDisplay), row, ">");
CLR_PRINTVALUE(p);
@ -639,6 +640,7 @@ static uint16_t cmsHandleKey(displayPort_t *pDisplay, uint8_t key)
switch (p->type) {
case OME_Submenu:
case OME_Funcall:
case OME_OSD_Exit:
if (p->func && key == KEY_RIGHT) {
p->func(pDisplay, p->data);