Merge pull request #7771 from thinkyhead/bf2_user_menu_return

[2.0.x] User menu return-to-status option
This commit is contained in:
Scott Lahteine 2017-09-27 11:51:57 -05:00 committed by GitHub
commit 88f9194168
30 changed files with 50 additions and 1 deletions

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1261,6 +1261,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1285,6 +1285,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1274,6 +1274,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1274,6 +1274,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1274,6 +1274,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1274,6 +1274,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1279,6 +1279,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1274,6 +1274,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -1272,6 +1272,7 @@
#if ENABLED(CUSTOM_USER_MENUS)
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN // Return to status screen after a script
#define USER_DESC_1 "Home & UBL Info"
#define USER_GCODE_1 "G28\nG29 W"

View file

@ -871,6 +871,9 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(USER_SCRIPT_AUDIBLE_FEEDBACK)
lcd_completion_feedback();
#endif
#if ENABLED(USER_SCRIPT_RETURN)
lcd_return_to_status();
#endif
}
#if defined(USER_DESC_1) && defined(USER_GCODE_1)
@ -3001,6 +3004,23 @@ void kill_screen(const char* lcd_msg) {
lcd_completion_feedback();
}
#if ENABLED(EEPROM_SETTINGS)
static void lcd_init_eeprom() {
lcd_factory_settings();
settings.save();
lcd_goto_previous_menu();
}
static void lcd_init_eeprom_confirm() {
START_MENU();
MENU_BACK(MSG_CONTROL);
MENU_ITEM(function, MSG_INIT_EEPROM, lcd_init_eeprom);
END_MENU();
}
#endif
void lcd_control_menu() {
START_MENU();
MENU_BACK(MSG_MAIN);
@ -3031,7 +3051,7 @@ void kill_screen(const char* lcd_msg) {
#endif
MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings);
#if ENABLED(EEPROM_SETTINGS)
MENU_ITEM(gcode, MSG_INIT_EEPROM, PSTR("M502\nM500")); // TODO: Add "Are You Sure?" step
MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm);
#endif
END_MENU();