Fix unable to go back from main menu to status screen.

This commit is contained in:
Marek Bel 2018-03-06 21:26:14 +01:00
parent e551ed1f6e
commit 020269a83c
2 changed files with 5 additions and 5 deletions

View File

@ -24,8 +24,9 @@ public:
MenuStack():m_stack(),m_index(0) {} MenuStack():m_stack(),m_index(0) {}
void push(menuFunc_t menu, uint8_t position); void push(menuFunc_t menu, uint8_t position);
Record pop(); Record pop();
void reset(){m_index = 0;}
private: private:
static const int max_depth = 3; static const int max_depth = 4;
Record m_stack[max_depth]; Record m_stack[max_depth];
uint8_t m_index; uint8_t m_index;
}; };

View File

@ -106,7 +106,7 @@ union Data
byte b[2]; byte b[2];
int value; int value;
}; };
static MenuStack menuStack;
int8_t ReInitLCD = 0; int8_t ReInitLCD = 0;
int8_t SDscrool = 0; int8_t SDscrool = 0;
@ -527,8 +527,8 @@ static void lcd_status_screen()
if (current_click && (lcd_commands_type != LCD_COMMAND_STOP_PRINT)) //click is aborted unless stop print finishes if (current_click && (lcd_commands_type != LCD_COMMAND_STOP_PRINT)) //click is aborted unless stop print finishes
{ {
menuStack.reset();
lcd_goto_menu(lcd_main_menu); menu_action_submenu(lcd_main_menu);
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
currentMenu == lcd_status_screen currentMenu == lcd_status_screen
@ -6663,7 +6663,6 @@ static void lcd_quick_feedback()
} }
/** Menu action functions **/ /** Menu action functions **/
static MenuStack menuStack;
/** /**
* @brief Go up in menu structure * @brief Go up in menu structure