From 235803bc2a2d46bc34dd4a426c68e2ac23c30963 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 6 Mar 2018 19:47:27 +0100 Subject: [PATCH 01/14] Move encoder stack to separate class MenuStack. Add menu record to MenuStack. It was needed to add menuFunc_t menu to stack, as in some places in menu, it is impossible to hardcode parent menu. Example: lcd_babystep_z can be invoked both from main_menu() and settings_menu() depending on printer status. --- Firmware/MenuStack.cpp | 29 ++++++++++++++++++++ Firmware/MenuStack.h | 33 +++++++++++++++++++++++ Firmware/ultralcd.cpp | 60 ++++++++++++++++++++++++------------------ 3 files changed, 97 insertions(+), 25 deletions(-) create mode 100644 Firmware/MenuStack.cpp create mode 100644 Firmware/MenuStack.h diff --git a/Firmware/MenuStack.cpp b/Firmware/MenuStack.cpp new file mode 100644 index 00000000..5e17a7d9 --- /dev/null +++ b/Firmware/MenuStack.cpp @@ -0,0 +1,29 @@ +/** + * @file + * @author Marek Bel + */ + +#include "MenuStack.h" +/** + * @brief Push menu on stack + * @param menu + * @param position selected position in menu being pushed + */ +void MenuStack::push(menuFunc_t menu, uint8_t position) +{ + if (m_index >= max_depth) return; + m_stack[m_index].menu = menu; + m_stack[m_index].position = position; + ++m_index; +} + +/** + * @brief Pop menu from stack + * @return Record containing menu function pointer and previously selected line number + */ +MenuStack::Record MenuStack::pop() +{ + if (m_index != 0) m_index--; + + return m_stack[m_index]; +} diff --git a/Firmware/MenuStack.h b/Firmware/MenuStack.h new file mode 100644 index 00000000..55c83690 --- /dev/null +++ b/Firmware/MenuStack.h @@ -0,0 +1,33 @@ +/** + * @file + * @author Marek Bel + */ + +#ifndef MENUSTACK_H +#define MENUSTACK_H + +#include + +/** Pointer to function implementing menu.*/ +typedef void (*menuFunc_t)(); +/** + * @brief Stack implementation for navigating menu structure + */ +class MenuStack +{ +public: + struct Record + { + menuFunc_t menu; + uint8_t position; + }; + MenuStack():m_stack(),m_index(0) {} + void push(menuFunc_t menu, uint8_t position); + Record pop(); +private: + static const int max_depth = 3; + Record m_stack[max_depth]; + uint8_t m_index; +}; + +#endif /* FIRMWARE_MENUSTACK_H_ */ diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index b892dca5..bdf7775f 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1,6 +1,7 @@ #include "temperature.h" #include "ultralcd.h" #ifdef ULTRA_LCD +#include "MenuStack.h" #include "Marlin.h" #include "language.h" #include "cardreader.h" @@ -39,7 +40,7 @@ extern bool fsensor_enabled; #endif //PAT9125 //Function pointer to menu functions. -typedef void (*menuFunc_t)(); + static void lcd_sd_updir(); @@ -223,7 +224,7 @@ static void lcd_delta_calibrate_menu(); static void lcd_quick_feedback();//Cause an LCD refresh, and give the user visual or audible feedback that something has happened /* Different types of actions that can be used in menu items. */ -static void menu_action_back(menuFunc_t data); +static void menu_action_back(menuFunc_t data = 0); #define menu_action_back_RAM menu_action_back static void menu_action_submenu(menuFunc_t data); static void menu_action_gcode(const char* pgcode); @@ -339,6 +340,22 @@ uint8_t lcdDrawUpdate = 2; /* Set to none-zero when the LCD nee // float raw_Ki, raw_Kd; #endif + +/** + * @brief Go to menu + * + * This function should not be used directly, use + * menu_action_back and menu_action_submenu instead. + * + * @param menu target menu + * @param encoder position in target menu + * @param feedback + * * true sound feedback (click) + * * false no feedback + * @param reset_menu_state + * * true reset menu state global union + * * false do not reset menu state global union + */ static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder = 0, const bool feedback = true, bool reset_menu_state = true) { asm("cli"); @@ -6647,32 +6664,25 @@ static void lcd_quick_feedback() lcd_implementation_quick_feedback(); } -#define ENC_STACK_SIZE 3 -static uint8_t enc_stack[ENC_STACK_SIZE]; //encoder is originaly uint16, but for menu -static uint8_t enc_stack_cnt = 0; - -static void lcd_push_encoder(void) -{ - if (enc_stack_cnt >= ENC_STACK_SIZE) return; - enc_stack[enc_stack_cnt] = encoderPosition; - enc_stack_cnt++; -} - -static void lcd_pop_encoder(void) -{ - if (enc_stack_cnt == 0) return; - enc_stack_cnt--; - encoderPosition = enc_stack[enc_stack_cnt]; -} - - /** Menu action functions **/ -static void menu_action_back(menuFunc_t data) { - lcd_goto_menu(data); - lcd_pop_encoder(); +static MenuStack menuStack; + +/** + * @brief Go up in menu structure + * @param data unused parameter + */ +static void menu_action_back(menuFunc_t data) +{ + MenuStack::Record record = menuStack.pop(); + lcd_goto_menu(record.menu); + encoderPosition = record.position; } +/** + * @brief Go deeper into menu structure + * @param data nested menu + */ static void menu_action_submenu(menuFunc_t data) { - lcd_push_encoder(); + menuStack.push(currentMenu, encoderPosition); lcd_goto_menu(data); } static void menu_action_gcode(const char* pgcode) { From e551ed1f6e394978dfeb32daf86eff56b0e56552 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 6 Mar 2018 19:51:13 +0100 Subject: [PATCH 02/14] Replace lcd_goto_menu(...) by menu_action_back() in lcd_menu_fails_stats(); --- Firmware/ultralcd.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index bdf7775f..e80d8046 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1634,9 +1634,7 @@ static void lcd_menu_fails_stats() fprintf_P(lcdout, PSTR(ESC_H(0,0)"Last print failures"ESC_H(1,1)"Filam. runouts %-3d"ESC_H(0,2)"Total failures"ESC_H(1,3)"Filam. runouts %-3d"), filamentLast, filamentTotal); if (lcd_clicked()) { - lcd_quick_feedback(); - //lcd_return_to_status(); - lcd_goto_menu(lcd_main_menu, 8); //TODO: Remove hard coded encoder value. + menu_action_back(); } } #endif //TMC2130 From 020269a83c00bb398fbdc0aab06bab1f0ccf8fd3 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 6 Mar 2018 21:26:14 +0100 Subject: [PATCH 03/14] Fix unable to go back from main menu to status screen. --- Firmware/MenuStack.h | 3 ++- Firmware/ultralcd.cpp | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/MenuStack.h b/Firmware/MenuStack.h index 55c83690..04754449 100644 --- a/Firmware/MenuStack.h +++ b/Firmware/MenuStack.h @@ -24,8 +24,9 @@ public: MenuStack():m_stack(),m_index(0) {} void push(menuFunc_t menu, uint8_t position); Record pop(); + void reset(){m_index = 0;} private: - static const int max_depth = 3; + static const int max_depth = 4; Record m_stack[max_depth]; uint8_t m_index; }; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e80d8046..a3a08bcc 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -106,7 +106,7 @@ union Data byte b[2]; int value; }; - +static MenuStack menuStack; int8_t ReInitLCD = 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 { - - lcd_goto_menu(lcd_main_menu); + menuStack.reset(); + menu_action_submenu(lcd_main_menu); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) currentMenu == lcd_status_screen @@ -6663,7 +6663,6 @@ static void lcd_quick_feedback() } /** Menu action functions **/ -static MenuStack menuStack; /** * @brief Go up in menu structure From ed0e7a8b58516976c3be7782c2bab11bb8b0d01d Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 6 Mar 2018 21:27:06 +0100 Subject: [PATCH 04/14] Preserve position in menu move axis. --- Firmware/ultralcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index a3a08bcc..43692d0a 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1534,7 +1534,7 @@ static void lcd_menu_extruder_info() lcd.print(itostr3(pat9125_b)); // Display LASER shutter time from Filament sensor - /* Shutter register is an index of LASER shutter time. It is automatically controlled by the chip’s internal + /* Shutter register is an index of LASER shutter time. It is automatically controlled by the chip�s internal auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small. When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to 46. */ @@ -2199,7 +2199,7 @@ static void _lcd_move(const char *name, int axis, int min, int max) { } } if (lcdDrawUpdate) lcd_implementation_drawedit(name, ftostr31(current_position[axis])); - if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); { + if (LCD_CLICKED) menu_action_back(); { } } From b7df176a466ac4690e79332726c2b696099c2a56 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 6 Mar 2018 22:45:47 +0100 Subject: [PATCH 05/14] Preserve position in menu Live adjust Z. --- Firmware/ultralcd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 43692d0a..917479c3 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -972,7 +972,8 @@ void lcd_commands() { lcd_implementation_clear(); - lcd_goto_menu(lcd_babystep_z, 0, false); + menuStack.reset(); + menu_action_submenu(lcd_babystep_z); enquecommand_P(PSTR("G1 X60.0 E9.0 F1000.0")); //intro line enquecommand_P(PSTR("G1 X100.0 E12.5 F1000.0")); //intro line enquecommand_P(PSTR("G92 E0.0")); @@ -2373,7 +2374,7 @@ static void _lcd_babystep(int axis, const char *msg) (axis == 0) ? EEPROM_BABYSTEP_X : ((axis == 1) ? EEPROM_BABYSTEP_Y : EEPROM_BABYSTEP_Z), &menuData.babyStep.babystepMem[axis]); } - if (LCD_CLICKED) lcd_goto_menu(lcd_main_menu); + if (LCD_CLICKED) menu_action_back(); } static void lcd_babystep_x() { From 77c3d7d7f7b7e7a6d7664c7c4d39acf2c33c6d30 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 16:47:20 +0100 Subject: [PATCH 06/14] Review and document lcd_adjust_bed_reset() lcd_goto_menu() usage. --- Firmware/ultralcd.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 917479c3..228fd763 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2389,6 +2389,14 @@ static void lcd_babystep_z() { static void lcd_adjust_bed(); +/** + * @brief adjust bed reset menu item function + * + * To be used as MENU_ITEM(function,...) inside lcd_adjust_bed submenu. In such case lcd_goto_menu usage + * is correct and doesn't break menuStack. + * Because we did not leave the menu, the menuData did not reset. + * Force refresh of the bed leveling data. + */ static void lcd_adjust_bed_reset() { eeprom_update_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID, 1); @@ -2396,9 +2404,7 @@ static void lcd_adjust_bed_reset() eeprom_update_byte((unsigned char*)EEPROM_BED_CORRECTION_RIGHT, 0); eeprom_update_byte((unsigned char*)EEPROM_BED_CORRECTION_FRONT, 0); eeprom_update_byte((unsigned char*)EEPROM_BED_CORRECTION_REAR , 0); - lcd_goto_menu(lcd_adjust_bed, 0, false); - // Because we did not leave the menu, the menuData did not reset. - // Force refresh of the bed leveling data. + lcd_goto_menu(lcd_adjust_bed, 0, false); //doesn't break menuStack menuData.adjustBed.status = 0; } From 0871925353ffa8371ed57c5de0d28df8b3b9a168 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 17:03:17 +0100 Subject: [PATCH 07/14] Remove special handling of lcd_move_z after long button press. Convert lcd_move_z after long button press to ordinary menu_action_submenu. Known bug (feature) is, that with current maximum stack depth, when long press is activated in menu > settings > move axis > Move X and then Move Z is deactivated, menu is returned to "move axis" and not to "Move X". --- Firmware/ultralcd.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 228fd763..13694ff9 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -321,14 +321,12 @@ volatile uint8_t slow_buttons;//Contains the bits of the currently pressed butto uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ uint8_t lastEncoderBits; uint16_t encoderPosition; -uint16_t savedEncoderPosition; #if (SDCARDDETECT > 0) bool lcd_oldcardstatus; #endif #endif //ULTIPANEL menuFunc_t currentMenu = lcd_status_screen; /* function pointer to the currently active menu */ -menuFunc_t savedMenu; uint32_t lcd_next_update_millis; uint8_t lcd_status_update_delay; bool ignore_click = false; @@ -7107,10 +7105,6 @@ void lcd_buttons_update() if (millis() > button_blanking_time) { button_blanking_time = millis() + BUTTON_BLANKING_TIME; if (button_pressed == false && long_press_active == false) { - if (currentMenu != lcd_move_z) { - savedMenu = currentMenu; - savedEncoderPosition = encoderPosition; - } long_press_timer = millis(); button_pressed = true; } @@ -7119,7 +7113,7 @@ void lcd_buttons_update() long_press_active = true; move_menu_scale = 1.0; - lcd_goto_menu(lcd_move_z); + menu_action_submenu(lcd_move_z); } } } @@ -7129,13 +7123,7 @@ void lcd_buttons_update() button_blanking_time = millis() + BUTTON_BLANKING_TIME; if (long_press_active == false) { //button released before long press gets activated - if (currentMenu == lcd_move_z) { - //return to previously active menu and previous encoder position - lcd_goto_menu(savedMenu, savedEncoderPosition); - } - else { newbutton |= EN_C; - } } else if (currentMenu == lcd_move_z) lcd_quick_feedback(); //button_pressed is set back to false via lcd_quick_feedback function From d0a98dc6cc3148ee5f133f28445f4c219b54f254 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 17:18:10 +0100 Subject: [PATCH 08/14] Document valid usage of lcd_goto_menu(). --- Firmware/ultralcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 13694ff9..d4a0d692 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3539,7 +3539,7 @@ static void lcd_fsensor_state_set() } } if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 7); - else lcd_goto_menu(lcd_settings_menu, 7); + else lcd_goto_menu(lcd_settings_menu, 7); //doesn't break menuStack } #endif //PAT9125 @@ -4627,7 +4627,7 @@ static void lcd_disable_farm_mode() { lcd_return_to_status(); } else { - lcd_goto_menu(lcd_settings_menu); + lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } lcd_update_enable(true); lcdDrawUpdate = 2; From 716098c4349c98b701b1436799879c84429a71fd Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 17:27:27 +0100 Subject: [PATCH 09/14] Preserve position in menu move axis Extruder. --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index d4a0d692..e212dae0 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -2220,7 +2220,7 @@ static void lcd_move_e() { lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS])); } - if (LCD_CLICKED) lcd_goto_menu(lcd_move_menu_axis); + if (LCD_CLICKED) menu_action_back(); } else { lcd_implementation_clear(); From 0c961dedc4898ba475872cdfbf5decbc658c14ce Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 18:15:24 +0100 Subject: [PATCH 10/14] Reset menu stack in lcd_return_to_status(). Mark menuStack.reset() as redundant in lcd_status_screen(), but leave it there to be sure. --- Firmware/ultralcd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e212dae0..0fb581ae 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -525,7 +525,7 @@ static void lcd_status_screen() if (current_click && (lcd_commands_type != LCD_COMMAND_STOP_PRINT)) //click is aborted unless stop print finishes { - menuStack.reset(); + menuStack.reset(); //redundant, as already done in lcd_return_to_status(), just to be sure menu_action_submenu(lcd_main_menu); lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. #if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) @@ -1381,6 +1381,7 @@ static void lcd_return_to_status() { ); lcd_goto_menu(lcd_status_screen, 0, false); + menuStack.reset(); } From 1aba60813329e3d0d018fd10c14a5b8615d5aa32 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 18:30:33 +0100 Subject: [PATCH 11/14] Document valid usage of lcd_goto_menu(), wrap lcd_second_serial_set() by HAS_SECOND_SERIAL_PORT macro. --- Firmware/ultralcd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 0fb581ae..461c19f6 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3608,13 +3608,15 @@ void lcd_temp_calibration_set() { lcd_goto_menu(lcd_settings_menu, 10); } +#ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; eeprom_update_byte((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); - lcd_goto_menu(lcd_settings_menu, 11); + lcd_goto_menu(lcd_settings_menu, 11);//doesn't break menuStack } +#endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); From 2a53686d2fa1a4f827c39b0a4338b9b70948fbec Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 19:33:40 +0100 Subject: [PATCH 12/14] Document valid usage of lcd_goto_menu(), remove redundant parameter. --- Firmware/ultralcd.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 461c19f6..39ef3c90 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -342,8 +342,11 @@ uint8_t lcdDrawUpdate = 2; /* Set to none-zero when the LCD nee /** * @brief Go to menu * - * This function should not be used directly, use - * menu_action_back and menu_action_submenu instead. + * In MENU_ITEM(submenu,... ) use MENU_ITEM(back,...) or + * menu_action_back() and menu_action_submenu() instead, otherwise menuStack will be broken. + * + * It is acceptable to call lcd_goto_menu(menu) directly from MENU_ITEM(function,...), if destination menu + * is the same, from which function was called. * * @param menu target menu * @param encoder position in target menu @@ -1817,13 +1820,13 @@ static void lcd_support_menu() void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED, fans_check_enabled); - lcd_goto_menu(lcd_settings_menu, 8); + lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } void lcd_set_filament_autoload() { filament_autoload_enabled = !filament_autoload_enabled; eeprom_update_byte((unsigned char *)EEPROM_FSENS_AUTOLOAD_ENABLED, filament_autoload_enabled); - lcd_goto_menu(lcd_settings_menu, 8); + lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } void lcd_unLoadFilament() @@ -3027,7 +3030,7 @@ static void lcd_show_end_stops() { static void menu_show_end_stops() { lcd_show_end_stops(); - if (LCD_CLICKED) lcd_goto_menu(lcd_calibration_menu); + if (LCD_CLICKED) lcd_goto_menu(lcd_calibration_menu); //doesn't break menuStack } // Lets the user move the Z carriage up to the end stoppers. @@ -3415,7 +3418,7 @@ static void lcd_sort_type_set() { } eeprom_update_byte((unsigned char *)EEPROM_SD_SORT, sdSort); presort_flag = true; - lcd_goto_menu(lcd_settings_menu, 8); + lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } #endif //SDCARD_SORT_ALPHA @@ -3605,7 +3608,7 @@ void lcd_temp_calibration_set() { temp_cal_active = !temp_cal_active; eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active); digipot_init(); - lcd_goto_menu(lcd_settings_menu, 10); + lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } #ifdef HAS_SECOND_SERIAL_PORT @@ -3614,7 +3617,7 @@ void lcd_second_serial_set() { else selectedSerialPort = 1; eeprom_update_byte((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); - lcd_goto_menu(lcd_settings_menu, 11);//doesn't break menuStack + lcd_goto_menu(lcd_settings_menu);//doesn't break menuStack } #endif //HAS_SECOND_SERIAL_PORT From 8ff028820a8805a0133b68633b9cadead9cf8fa5 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 20:55:01 +0100 Subject: [PATCH 13/14] Remove redundant parameter. --- Firmware/ultralcd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 39ef3c90..6dab1bd2 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3542,8 +3542,8 @@ static void lcd_fsensor_state_set() lcd_fsensor_fail(); } } - if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu, 7); - else lcd_goto_menu(lcd_settings_menu, 7); //doesn't break menuStack + if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL)) lcd_goto_menu(lcd_tune_menu); + else lcd_goto_menu(lcd_settings_menu); //doesn't break menuStack } #endif //PAT9125 From b41d680adf75b0171690a9105790e21126bdbc69 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Wed, 7 Mar 2018 20:58:15 +0100 Subject: [PATCH 14/14] Replace problematic character in comment. --- Firmware/ultralcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 6dab1bd2..2d346484 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1537,7 +1537,7 @@ static void lcd_menu_extruder_info() lcd.print(itostr3(pat9125_b)); // Display LASER shutter time from Filament sensor - /* Shutter register is an index of LASER shutter time. It is automatically controlled by the chip�s internal + /* Shutter register is an index of LASER shutter time. It is automatically controlled by the chip's internal auto-exposure algorithm. When the chip is tracking on a good reflection surface, the Shutter is small. When the chip is tracking on a poor reflection surface, the Shutter is large. Value ranges from 0 to 46. */