Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2021-01-12 17:16:15 +01:00
118 changed files with 7785 additions and 6935 deletions
@@ -25,6 +25,8 @@ void menuGhostModuleConfig(event_t event)
switch (event) {
case EVT_ENTRY:
memclear(&reusableBuffer.ghostMenu, sizeof(reusableBuffer.ghostMenu));
strAppend((char *) &reusableBuffer.ghostMenu.line[1].menuText, STR_WAITING_FOR_MODULE, 0);
reusableBuffer.ghostMenu.line[1].lineFlags = GHST_LINE_FLAGS_VALUE_EDIT;
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
@@ -40,6 +42,7 @@ void menuGhostModuleConfig(event_t event)
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_JOYUP;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_NONE;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
audioKeyPress();
break;
#if defined(ROTARY_ENCODER_NAVIGATION)
@@ -52,6 +55,7 @@ void menuGhostModuleConfig(event_t event)
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_JOYDOWN;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_NONE;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
audioKeyPress();
break;
@@ -59,12 +63,14 @@ void menuGhostModuleConfig(event_t event)
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_JOYPRESS;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_NONE;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
audioKeyPress();
break;
case EVT_KEY_BREAK(KEY_EXIT):
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_JOYLEFT;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_NONE;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
audioKeyPress();
break;
case EVT_KEY_LONG(KEY_EXIT):
@@ -78,7 +84,12 @@ void menuGhostModuleConfig(event_t event)
break;
}
if (reusableBuffer.ghostMenu.menuAction == GHST_MENU_CTRL_CLOSE) {
if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_UNOPENED) { // Handles situation where module is plugged after tools start
reusableBuffer.ghostMenu.buttonAction = GHST_BTN_NONE;
reusableBuffer.ghostMenu.menuAction = GHST_MENU_CTRL_OPEN;
moduleState[EXTERNAL_MODULE].counter = GHST_MENU_CONTROL;
}
else if (reusableBuffer.ghostMenu.menuStatus == GHST_MENU_STATUS_CLOSING) {
popMenu();
}
@@ -104,6 +115,8 @@ void menuGhostModuleConfig(event_t event)
else {
if (reusableBuffer.ghostMenu.line[line].lineFlags & GHST_LINE_FLAGS_LABEL_SELECT)
flags = INVERS;
if (reusableBuffer.ghostMenu.line[line].lineFlags & GHST_LINE_FLAGS_VALUE_EDIT)
flags |= BLINK;
lcdDrawText(xOffset, yOffset + line * FH, reusableBuffer.ghostMenu.line[line].menuText, flags);
}
}