Add SD Firmware Update capability (#12043)

Co-Authored-By: timoxd7 <timoxd7@users.noreply.github.com>
This commit is contained in:
Scott Lahteine
2018-10-09 20:00:47 -05:00
committed by GitHub
parent 0bd54392b7
commit cf5284cdf2
64 changed files with 974 additions and 2 deletions

View File

@ -160,6 +160,8 @@
#define MSG_LOAD_EEPROM _UxGT("Konfig. laden")
#define MSG_RESTORE_FAILSAFE _UxGT("Standardwerte laden")
#define MSG_INIT_EEPROM _UxGT("Werkseinstellungen")
#define MSG_SD_UPDATE _UxGT("SD Update")
#define MSG_RESET_PRINTER _UxGT("Drucker neustarten")
#define MSG_REFRESH _UxGT("Aktualisieren")
#define MSG_WATCH _UxGT("Info")
#define MSG_PREPARE _UxGT("Vorbereitung")

View File

@ -687,6 +687,12 @@
#ifndef MSG_INIT_EEPROM
#define MSG_INIT_EEPROM _UxGT("Initialize EEPROM")
#endif
#ifndef MSG_SD_UPDATE
#define MSG_SD_UPDATE _UxGT("SD Update")
#endif
#ifndef MSG_RESET_PRINTER
#define MSG_RESET_PRINTER _UxGT("Reset Printer")
#endif
#ifndef MSG_REFRESH
#define MSG_REFRESH _UxGT("Refresh")
#endif

View File

@ -3996,6 +3996,18 @@ void lcd_quick_feedback(const bool clear_buttons) {
}
#endif
#if ENABLED(SD_FIRMWARE_UPDATE)
/**
* Toggle the SD Firmware Update state in EEPROM
*/
static void _lcd_toggle_sd_update() {
const bool new_state = !settings.sd_update_status();
lcd_completion_feedback(settings.set_sd_update_status(new_state));
lcd_return_to_status();
if (new_state) LCD_MESSAGEPGM(MSG_RESET_PRINTER); else lcd_reset_status();
}
#endif
void lcd_advanced_settings_menu() {
START_MENU();
MENU_BACK(MSG_CONFIGURATION);
@ -4068,6 +4080,11 @@ void lcd_quick_feedback(const bool clear_buttons) {
MENU_ITEM(gcode, MSG_BLTOUCH_RESET, PSTR("M280 P" STRINGIFY(Z_PROBE_SERVO_NR) " S" STRINGIFY(BLTOUCH_RESET)));
#endif
#if ENABLED(SD_FIRMWARE_UPDATE)
bool sd_update_state = settings.sd_update_status();
MENU_ITEM_EDIT_CALLBACK(bool, MSG_SD_UPDATE, &sd_update_state, _lcd_toggle_sd_update);
#endif
#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
MENU_ITEM(submenu, MSG_INIT_EEPROM, lcd_init_eeprom_confirm);
#endif