Fixes #6727
This commit is contained in:
@@ -281,6 +281,7 @@ void onMainViewMenu(const char *result)
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER3);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
telemetryReset();
|
||||
|
||||
@@ -342,7 +342,7 @@ void menuMainViewChannelsMonitor(event_t event)
|
||||
return menuChannelsView(event);
|
||||
}
|
||||
|
||||
void onMainViewMenu(const char *result)
|
||||
void onMainViewMenu(const char * result)
|
||||
{
|
||||
if (result == STR_RESET_TIMER1) {
|
||||
timerReset(0);
|
||||
@@ -364,6 +364,7 @@ void onMainViewMenu(const char *result)
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER3);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
telemetryReset();
|
||||
@@ -409,16 +410,6 @@ void displaySwitch(coord_t x, coord_t y, int width, unsigned int index)
|
||||
}
|
||||
}
|
||||
|
||||
bool isMenuAvailable(int index)
|
||||
{
|
||||
if (index == 4) {
|
||||
return modelHasNotes();
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int getSwitchCount()
|
||||
{
|
||||
int count = 0;
|
||||
@@ -435,7 +426,6 @@ void menuMainView(event_t event)
|
||||
static bool secondPage = false;
|
||||
|
||||
switch(event) {
|
||||
|
||||
case EVT_ENTRY:
|
||||
killEvents(KEY_EXIT);
|
||||
killEvents(KEY_UP);
|
||||
|
||||
@@ -557,6 +557,9 @@ inline void POPUP_MENU_START(PopupMenuHandler handler)
|
||||
inline void CLEAR_POPUP()
|
||||
{
|
||||
warningText = nullptr;
|
||||
warningInfoText = nullptr;
|
||||
popupMenuHandler = nullptr;
|
||||
popupMenuItemsCount = 0;
|
||||
}
|
||||
|
||||
inline void POPUP_WAIT(const char * s)
|
||||
|
||||
@@ -114,6 +114,7 @@ void onMainViewMenu(const char *result)
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER2);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TIMER3);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
else if (result == STR_RESET_TELEMETRY) {
|
||||
telemetryReset();
|
||||
|
||||
@@ -79,6 +79,9 @@ enum
|
||||
inline void CLEAR_POPUP()
|
||||
{
|
||||
warningText = nullptr;
|
||||
warningInfoText = nullptr;
|
||||
popupMenuHandler = nullptr;
|
||||
popupMenuItemsCount = 0;
|
||||
}
|
||||
|
||||
inline void POPUP_WAIT(const char * s)
|
||||
|
||||
+3
-4
@@ -291,7 +291,7 @@ void guiMain(event_t evt)
|
||||
|
||||
if (!refreshNeeded) {
|
||||
DEBUG_TIMER_START(debugTimerMenus);
|
||||
while (1) {
|
||||
while (true) {
|
||||
// normal GUI from menus
|
||||
const char * warn = warningText;
|
||||
uint8_t menu = popupMenuItemsCount;
|
||||
@@ -315,7 +315,7 @@ void guiMain(event_t evt)
|
||||
if (result) {
|
||||
TRACE("popupMenuHandler(%s)", result);
|
||||
auto handler = popupMenuHandler;
|
||||
popupMenuHandler = nullptr;
|
||||
CLEAR_POPUP();
|
||||
handler(result);
|
||||
if (menuEvent == 0) {
|
||||
evt = EVT_REFRESH;
|
||||
@@ -391,7 +391,6 @@ void handleGui(event_t event) {
|
||||
}
|
||||
}
|
||||
menuHandlers[menuLevel](event);
|
||||
// todo drawStatusLine(); here???
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -456,7 +455,7 @@ void guiMain(event_t evt)
|
||||
if (result) {
|
||||
TRACE("popupMenuHandler(%s)", result);
|
||||
auto handler = popupMenuHandler;
|
||||
popupMenuHandler = nullptr;
|
||||
CLEAR_POPUP();
|
||||
handler(result);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ TASK_FUNCTION(menusTask)
|
||||
opentxInit();
|
||||
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
while (1) {
|
||||
while (true) {
|
||||
uint32_t pwr_check = pwrCheck();
|
||||
if (pwr_check == e_power_off) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user