Impossible to exit BIND mode with [Enter]

(and need to switch the radio off ...)
This commit is contained in:
Bertrand Songis
2019-08-20 10:43:33 +02:00
parent 0bde2d3d93
commit af60a3b787
7 changed files with 15 additions and 21 deletions
-1
View File
@@ -1538,7 +1538,6 @@ void menuModelSetup(event_t event)
} }
#endif #endif
#if 0 #if 0
case ITEM_MODEL_SETUP_PPM2_PROTOCOL: case ITEM_MODEL_SETUP_PPM2_PROTOCOL:
lcdDrawTextAlignedLeft(y, "Port2"); lcdDrawTextAlignedLeft(y, "Port2");
@@ -341,8 +341,7 @@ void modelSetupModulePxx2ReceiverLine(uint8_t moduleIdx, uint8_t receiverIdx, co
} }
} }
if (attr && EVT_KEY_MASK(event) == KEY_ENTER) { if (attr && event == EVT_KEY_BREAK(KEY_ENTER)) {
killEvents(event);
POPUP_MENU_ADD_ITEM(STR_BIND); POPUP_MENU_ADD_ITEM(STR_BIND);
POPUP_MENU_ADD_ITEM(STR_OPTIONS); POPUP_MENU_ADD_ITEM(STR_OPTIONS);
POPUP_MENU_ADD_ITEM(STR_SHARE); POPUP_MENU_ADD_ITEM(STR_SHARE);
+3 -3
View File
@@ -242,8 +242,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
} }
switch (event) switch (event) {
{
case EVT_ENTRY: case EVT_ENTRY:
menuEntryTime = get_tmr10ms(); menuEntryTime = get_tmr10ms();
l_posVert = 0; l_posVert = 0;
@@ -271,7 +270,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
case EVT_KEY_FIRST(KEY_ENTER): case EVT_KEY_FIRST(KEY_ENTER):
if (!menuTab || l_posVert>0) { if (!menuTab || l_posVert>0) {
if (READ_ONLY_UNLOCKED()) { if (READ_ONLY_UNLOCKED()) {
s_editMode = (s_editMode<=0); s_editMode = (s_editMode <= 0);
} }
} }
break; break;
@@ -287,6 +286,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
} }
// no break // no break
#endif #endif
case EVT_KEY_LONG(KEY_EXIT): case EVT_KEY_LONG(KEY_EXIT):
s_editMode = 0; // TODO needed? we call ENTRY_UP after which does the same s_editMode = 0; // TODO needed? we call ENTRY_UP after which does the same
popMenu(); popMenu();
+2 -1
View File
@@ -262,7 +262,8 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
break; break;
case EVT_ROTARY_BREAK: case EVT_ROTARY_BREAK:
if (s_editMode > 1) break; if (s_editMode > 1)
break;
if (menuHorizontalPosition < 0 && maxcol > 0 && READ_ONLY_UNLOCKED()) { if (menuHorizontalPosition < 0 && maxcol > 0 && READ_ONLY_UNLOCKED()) {
l_posHorz = 0; l_posHorz = 0;
AUDIO_KEY_PRESS(); AUDIO_KEY_PRESS();
+2 -1
View File
@@ -373,7 +373,8 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
break; break;
case EVT_KEY_BREAK(KEY_ENTER): case EVT_KEY_BREAK(KEY_ENTER):
if (s_editMode > 1) break; if (s_editMode > 1)
break;
if (menuHorizontalPosition < 0 && maxcol > 0 && READ_ONLY_UNLOCKED()) { if (menuHorizontalPosition < 0 && maxcol > 0 && READ_ONLY_UNLOCKED()) {
l_posHorz = 0; l_posHorz = 0;
AUDIO_KEY_PRESS(); AUDIO_KEY_PRESS();
@@ -145,7 +145,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
} }
} }
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER))) { if (!READ_ONLY() && i_min == 0 && i_max == 1 && event == EVT_KEY_BREAK(KEY_ENTER)) {
s_editMode = 0; s_editMode = 0;
newval = !val; newval = !val;
} }
@@ -318,8 +318,7 @@ void check(event_t event, uint8_t curr, const MenuHandlerFunc *menuTab, uint8_t
drawScreenIndex(curr, menuTabSize, attr); drawScreenIndex(curr, menuTabSize, attr);
} }
switch (event) switch (event) {
{
case EVT_ENTRY: case EVT_ENTRY:
menuEntryTime = get_tmr10ms(); menuEntryTime = get_tmr10ms();
l_posVert = 0; l_posVert = 0;
+5 -10
View File
@@ -152,15 +152,6 @@ class OtaUpdateInformation: public BindInformation {
typedef void (* ModuleCallback)(); typedef void (* ModuleCallback)();
#if defined(SIMU)
#define BIND_INFO \
bindInformation->candidateReceiversCount = 2; \
strcpy(bindInformation->candidateReceiversNames[0], "SimuRX1"); \
strcpy(bindInformation->candidateReceiversNames[1], "SimuRX2");
#else
#define BIND_INFO
#endif
PACK(struct ModuleState { PACK(struct ModuleState {
uint8_t protocol:4; uint8_t protocol:4;
uint8_t mode:4; uint8_t mode:4;
@@ -181,7 +172,11 @@ PACK(struct ModuleState {
bindInformation = destination; bindInformation = destination;
callback = bindCallback; callback = bindCallback;
mode = MODULE_MODE_BIND; mode = MODULE_MODE_BIND;
BIND_INFO; #if defined(SIMU)
bindInformation->candidateReceiversCount = 2;
strcpy(bindInformation->candidateReceiversNames[0], "SimuRX1");
strcpy(bindInformation->candidateReceiversNames[1], "SimuRX2");
#endif
} }
void readModuleInformation(ModuleInformation * destination, int8_t first, int8_t last) void readModuleInformation(ModuleInformation * destination, int8_t first, int8_t last)
{ {