From b904b5ae8d2317a31fcc16a04f8d5fa8967e38d1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Mar 2017 06:10:31 -0500 Subject: [PATCH] Audible feedback for settings store/load/reset --- Marlin/Marlin_main.cpp | 20 ++++---- Marlin/configuration_store.cpp | 12 +++-- Marlin/configuration_store.h | 6 +-- Marlin/language_an.h | 4 +- Marlin/language_bg.h | 4 +- Marlin/language_ca.h | 4 +- Marlin/language_cn.h | 4 +- Marlin/language_cz.h | 4 +- Marlin/language_da.h | 4 +- Marlin/language_de.h | 4 +- Marlin/language_el-gr.h | 4 +- Marlin/language_el.h | 4 +- Marlin/language_en.h | 4 +- Marlin/language_es.h | 4 +- Marlin/language_eu.h | 4 +- Marlin/language_fi.h | 4 +- Marlin/language_fr.h | 4 +- Marlin/language_gl.h | 4 +- Marlin/language_hr.h | 4 +- Marlin/language_it.h | 4 +- Marlin/language_kana.h | 4 +- Marlin/language_kana_utf8.h | 4 +- Marlin/language_nl.h | 4 +- Marlin/language_pl.h | 4 +- Marlin/language_pt-br.h | 4 +- Marlin/language_pt-br_utf8.h | 4 +- Marlin/language_pt.h | 4 +- Marlin/language_pt_utf8.h | 4 +- Marlin/language_ru.h | 4 +- Marlin/language_tr.h | 4 +- Marlin/language_uk.h | 4 +- Marlin/language_zh_CN.h | 4 +- Marlin/language_zh_TW.h | 4 +- Marlin/ultralcd.cpp | 90 ++++++++++++++++++++-------------- Marlin/ultralcd.h | 5 +- 35 files changed, 137 insertions(+), 116 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7d5cf729a..18fffc911 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3792,10 +3792,8 @@ inline void gcode_G28() { mbl.set_has_mesh(true); mbl.set_reactivate(true); enqueue_and_echo_commands_P(PSTR("G28")); - #if HAS_BUZZER - lcd_buzz(200, 659); - lcd_buzz(200, 698); - #endif + BUZZ(100, 659); + BUZZ(100, 698); } break; @@ -7289,8 +7287,8 @@ void quickstop_stepper() { SYNC_PLAN_POSITION_KINEMATIC(); report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); - BUZZ(200, 659); - BUZZ(200, 698); + BUZZ(100, 659); + BUZZ(100, 698); } } @@ -7300,28 +7298,28 @@ void quickstop_stepper() { * M500: Store settings in EEPROM */ inline void gcode_M500() { - Config_StoreSettings(); + (void)Config_StoreSettings(); } /** * M501: Read settings from EEPROM */ inline void gcode_M501() { - Config_RetrieveSettings(); + (void)Config_RetrieveSettings(); } /** * M502: Revert to default settings */ inline void gcode_M502() { - Config_ResetDefault(); + (void)Config_ResetDefault(); } /** * M503: print settings currently in memory */ inline void gcode_M503() { - Config_PrintSettings(code_seen('S') && !code_value_bool()); + (void)Config_PrintSettings(code_seen('S') && !code_value_bool()); } #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) @@ -10696,7 +10694,7 @@ void setup() { // Load data from EEPROM if available (or use defaults) // This also updates variables in the planner, elsewhere - Config_RetrieveSettings(); + (void)Config_RetrieveSettings(); #if DISABLED(NO_WORKSPACE_OFFSETS) // Initialize current position based on home_offset diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index ffe9fc36e..09e89940c 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -250,7 +250,7 @@ void Config_Postprocess() { /** * M500 - Store Configuration */ - void Config_StoreSettings() { + bool Config_StoreSettings() { float dummy = 0.0f; char ver[4] = "000"; @@ -538,17 +538,20 @@ void Config_Postprocess() { SERIAL_ECHOPAIR("Settings Stored (", eeprom_size - (EEPROM_OFFSET)); SERIAL_ECHOLNPGM(" bytes)"); } + #if ENABLED(AUTO_BED_LEVELING_UBL) blm.store_state(); if (blm.state.EEPROM_storage_slot >= 0) blm.store_mesh(blm.state.EEPROM_storage_slot); #endif + + return !eeprom_write_error; } /** * M501 - Retrieve Configuration */ - void Config_RetrieveSettings() { + bool Config_RetrieveSettings() { EEPROM_START(); eeprom_read_error = false; // If set EEPROM_READ won't write into RAM @@ -883,13 +886,16 @@ void Config_Postprocess() { #if ENABLED(EEPROM_CHITCHAT) Config_PrintSettings(); #endif + + return !eeprom_read_error; } #else // !EEPROM_SETTINGS - void Config_StoreSettings() { + bool Config_StoreSettings() { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("EEPROM disabled"); + return false; } #endif // !EEPROM_SETTINGS diff --git a/Marlin/configuration_store.h b/Marlin/configuration_store.h index 7279dc4d5..93dbb7404 100644 --- a/Marlin/configuration_store.h +++ b/Marlin/configuration_store.h @@ -26,7 +26,7 @@ #include "MarlinConfig.h" void Config_ResetDefault(); -void Config_StoreSettings(); +bool Config_StoreSettings(); #if DISABLED(DISABLE_M503) void Config_PrintSettings(bool forReplay=false); @@ -35,9 +35,9 @@ void Config_StoreSettings(); #endif #if ENABLED(EEPROM_SETTINGS) - void Config_RetrieveSettings(); + bool Config_RetrieveSettings(); #else - FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); } + FORCE_INLINE bool Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); return true; } #endif #endif //CONFIGURATION_STORE_H diff --git a/Marlin/language_an.h b/Marlin/language_an.h index 421e33c5c..1ee83c423 100644 --- a/Marlin/language_an.h +++ b/Marlin/language_an.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EPROM _UxGT("Alzar memoria") -#define MSG_LOAD_EPROM _UxGT("Cargar memoria") +#define MSG_STORE_EEPROM _UxGT("Alzar memoria") +#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") #define MSG_REFRESH _UxGT("Tornar a cargar") #define MSG_WATCH _UxGT("Informacion") diff --git a/Marlin/language_bg.h b/Marlin/language_bg.h index 0499b1ecd..2349610f1 100644 --- a/Marlin/language_bg.h +++ b/Marlin/language_bg.h @@ -119,8 +119,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Диам. нишка") #define MSG_CONTRAST _UxGT("LCD контраст") -#define MSG_STORE_EPROM _UxGT("Запази в EPROM") -#define MSG_LOAD_EPROM _UxGT("Зареди от EPROM") +#define MSG_STORE_EEPROM _UxGT("Запази в EPROM") +#define MSG_LOAD_EEPROM _UxGT("Зареди от EPROM") #define MSG_RESTORE_FAILSAFE _UxGT("Фабрични настройки") #define MSG_REFRESH LCD_STR_REFRESH _UxGT("Обнови") #define MSG_WATCH _UxGT("Преглед") diff --git a/Marlin/language_ca.h b/Marlin/language_ca.h index 24bb53a4e..796f2a7da 100644 --- a/Marlin/language_ca.h +++ b/Marlin/language_ca.h @@ -123,8 +123,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") #define MSG_CONTRAST _UxGT("Contrast de LCD") -#define MSG_STORE_EPROM _UxGT("Desa memoria") -#define MSG_LOAD_EPROM _UxGT("Carrega memoria") +#define MSG_STORE_EEPROM _UxGT("Desa memoria") +#define MSG_LOAD_EEPROM _UxGT("Carrega memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Restaura valors") #define MSG_REFRESH _UxGT("Actualitza") #define MSG_WATCH _UxGT("Pantalla Info.") diff --git a/Marlin/language_cn.h b/Marlin/language_cn.h index 0c01a1511..2ef90b7d7 100644 --- a/Marlin/language_cn.h +++ b/Marlin/language_cn.h @@ -111,8 +111,8 @@ #define MSG_VOLUMETRIC_ENABLED "E in mm3" #define MSG_FILAMENT_DIAM "Fil. Dia." #define MSG_CONTRAST "LCD contrast" -#define MSG_STORE_EPROM "Store memory" -#define MSG_LOAD_EPROM "Load memory" +#define MSG_STORE_EEPROM "Store memory" +#define MSG_LOAD_EEPROM "Load memory" #define MSG_RESTORE_FAILSAFE "Restore failsafe" #define MSG_REFRESH "Refresh" #define MSG_WATCH "\xec\xed\xee\xef" diff --git a/Marlin/language_cz.h b/Marlin/language_cz.h index a92bbcbff..d53ff6dda 100644 --- a/Marlin/language_cz.h +++ b/Marlin/language_cz.h @@ -122,8 +122,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E na mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Prum.") #define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EPROM _UxGT("Ulozit nastaveni") -#define MSG_LOAD_EPROM _UxGT("Nacist nastaveni") +#define MSG_STORE_EEPROM _UxGT("Ulozit nastaveni") +#define MSG_LOAD_EEPROM _UxGT("Nacist nastaveni") #define MSG_RESTORE_FAILSAFE _UxGT("Obnovit vychozi") #define MSG_REFRESH _UxGT("Obnovit") #define MSG_WATCH _UxGT("Info obrazovka") diff --git a/Marlin/language_da.h b/Marlin/language_da.h index 3f5ae6972..9a963455c 100644 --- a/Marlin/language_da.h +++ b/Marlin/language_da.h @@ -120,8 +120,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E i mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("LCD kontrast") -#define MSG_STORE_EPROM _UxGT("Gem i EEPROM") -#define MSG_LOAD_EPROM _UxGT("Hent fra EEPROM") +#define MSG_STORE_EEPROM _UxGT("Gem i EEPROM") +#define MSG_LOAD_EEPROM _UxGT("Hent fra EEPROM") #define MSG_RESTORE_FAILSAFE _UxGT("Gendan failsafe") #define MSG_REFRESH _UxGT("Genopfrisk") #define MSG_WATCH _UxGT("Info skærm") diff --git a/Marlin/language_de.h b/Marlin/language_de.h index 460fa3944..8a61bb163 100644 --- a/Marlin/language_de.h +++ b/Marlin/language_de.h @@ -124,8 +124,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") #define MSG_FILAMENT_DIAM _UxGT("D Fil.") #define MSG_CONTRAST _UxGT("LCD Kontrast") -#define MSG_STORE_EPROM _UxGT("EPROM speichern") -#define MSG_LOAD_EPROM _UxGT("EPROM laden") +#define MSG_STORE_EEPROM _UxGT("EPROM speichern") +#define MSG_LOAD_EEPROM _UxGT("EPROM laden") #define MSG_RESTORE_FAILSAFE _UxGT("Standardkonfiguration") #define MSG_REFRESH _UxGT("Aktualisieren") #define MSG_WATCH _UxGT("Info") diff --git a/Marlin/language_el-gr.h b/Marlin/language_el-gr.h index 3e115e19b..273a07a1d 100644 --- a/Marlin/language_el-gr.h +++ b/Marlin/language_el-gr.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") #define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") #define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EPROM _UxGT("Φόρτωση") +#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") +#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") #define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") #define MSG_REFRESH _UxGT("Ανανέωση") #define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") diff --git a/Marlin/language_el.h b/Marlin/language_el.h index f91244601..3f99b2b83 100644 --- a/Marlin/language_el.h +++ b/Marlin/language_el.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("Ε σε μμ3") #define MSG_FILAMENT_DIAM _UxGT("Διάμετρος νήματος") #define MSG_CONTRAST _UxGT("Κοντράστ LCD") -#define MSG_STORE_EPROM _UxGT("Αποθήκευση") -#define MSG_LOAD_EPROM _UxGT("Φόρτωση") +#define MSG_STORE_EEPROM _UxGT("Αποθήκευση") +#define MSG_LOAD_EEPROM _UxGT("Φόρτωση") #define MSG_RESTORE_FAILSAFE _UxGT("Επαναφορά ασφαλούς αντιγράφου") //SHORTEN #define MSG_REFRESH _UxGT("Ανανέωση") #define MSG_WATCH _UxGT("Οθόνη πληροφόρησης") diff --git a/Marlin/language_en.h b/Marlin/language_en.h index 6af3fcbf7..b0ad5c986 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -310,10 +310,10 @@ #define MSG_CONTRAST _UxGT("LCD contrast") #endif #ifndef MSG_STORE_EPROM - #define MSG_STORE_EPROM _UxGT("Store memory") + #define MSG_STORE_EEPROM _UxGT("Store memory") #endif #ifndef MSG_LOAD_EPROM - #define MSG_LOAD_EPROM _UxGT("Load memory") + #define MSG_LOAD_EEPROM _UxGT("Load memory") #endif #ifndef MSG_RESTORE_FAILSAFE #define MSG_RESTORE_FAILSAFE _UxGT("Restore failsafe") diff --git a/Marlin/language_es.h b/Marlin/language_es.h index fc54601f1..0da06d43b 100644 --- a/Marlin/language_es.h +++ b/Marlin/language_es.h @@ -122,8 +122,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EPROM _UxGT("Guardar memoria") -#define MSG_LOAD_EPROM _UxGT("Cargar memoria") +#define MSG_STORE_EEPROM _UxGT("Guardar memoria") +#define MSG_LOAD_EEPROM _UxGT("Cargar memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Restaurar memoria") #define MSG_REFRESH _UxGT("Volver a cargar") #define MSG_WATCH _UxGT("Informacion") diff --git a/Marlin/language_eu.h b/Marlin/language_eu.h index 116d1e20c..a83edb700 100644 --- a/Marlin/language_eu.h +++ b/Marlin/language_eu.h @@ -109,8 +109,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("LCD kontrastea") -#define MSG_STORE_EPROM _UxGT("Gorde memoria") -#define MSG_LOAD_EPROM _UxGT("Kargatu memoria") +#define MSG_STORE_EEPROM _UxGT("Gorde memoria") +#define MSG_LOAD_EEPROM _UxGT("Kargatu memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Larri. berriz.") #define MSG_REFRESH _UxGT("Berriz kargatu") #define MSG_WATCH _UxGT("Pantaila info") diff --git a/Marlin/language_fi.h b/Marlin/language_fi.h index 7fde1ca42..8072a8afe 100644 --- a/Marlin/language_fi.h +++ b/Marlin/language_fi.h @@ -110,8 +110,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm³") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("LCD kontrasti") -#define MSG_STORE_EPROM _UxGT("Tallenna muistiin") -#define MSG_LOAD_EPROM _UxGT("Lataa muistista") +#define MSG_STORE_EEPROM _UxGT("Tallenna muistiin") +#define MSG_LOAD_EEPROM _UxGT("Lataa muistista") #define MSG_RESTORE_FAILSAFE _UxGT("Palauta oletus") #define MSG_REFRESH _UxGT("Päivitä") #define MSG_WATCH _UxGT("Seuraa") diff --git a/Marlin/language_fr.h b/Marlin/language_fr.h index c8681c399..c4e1b6e66 100644 --- a/Marlin/language_fr.h +++ b/Marlin/language_fr.h @@ -123,8 +123,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. Fil.") #define MSG_CONTRAST _UxGT("Contraste LCD") -#define MSG_STORE_EPROM _UxGT("Sauver config") -#define MSG_LOAD_EPROM _UxGT("Lire config") +#define MSG_STORE_EEPROM _UxGT("Sauver config") +#define MSG_LOAD_EEPROM _UxGT("Lire config") #define MSG_RESTORE_FAILSAFE _UxGT("Restaurer défauts") #define MSG_REFRESH _UxGT("Actualiser") #define MSG_WATCH _UxGT("Surveiller") diff --git a/Marlin/language_gl.h b/Marlin/language_gl.h index 337871a11..442af39ff 100644 --- a/Marlin/language_gl.h +++ b/Marlin/language_gl.h @@ -119,8 +119,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E en mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. fil.") #define MSG_CONTRAST _UxGT("Constraste LCD") -#define MSG_STORE_EPROM _UxGT("Gardar en memo.") -#define MSG_LOAD_EPROM _UxGT("Cargar de memo.") +#define MSG_STORE_EEPROM _UxGT("Gardar en memo.") +#define MSG_LOAD_EEPROM _UxGT("Cargar de memo.") #define MSG_RESTORE_FAILSAFE _UxGT("Cargar de firm.") #define MSG_REFRESH _UxGT("Volver a cargar") #define MSG_WATCH _UxGT("Monitorizacion") diff --git a/Marlin/language_hr.h b/Marlin/language_hr.h index e23269d17..3a326793d 100644 --- a/Marlin/language_hr.h +++ b/Marlin/language_hr.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("Kontrast LCD-a") -#define MSG_STORE_EPROM _UxGT("Pohrani u memoriju") -#define MSG_LOAD_EPROM _UxGT("Učitaj memoriju") +#define MSG_STORE_EEPROM _UxGT("Pohrani u memoriju") +#define MSG_LOAD_EEPROM _UxGT("Učitaj memoriju") #define MSG_RESTORE_FAILSAFE _UxGT("Učitaj failsafe") #define MSG_REFRESH _UxGT("Osvježi") #define MSG_WATCH _UxGT("Info screen") diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 3e1367772..fe1608e7e 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -126,8 +126,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Diam. filo") #define MSG_CONTRAST _UxGT("Contrasto LCD") -#define MSG_STORE_EPROM _UxGT("Salva in memoria") -#define MSG_LOAD_EPROM _UxGT("Carica da memoria") +#define MSG_STORE_EEPROM _UxGT("Salva in memoria") +#define MSG_LOAD_EEPROM _UxGT("Carica da memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Ripristina imp.") #define MSG_REFRESH _UxGT("Aggiorna") #define MSG_WATCH _UxGT("Guarda") diff --git a/Marlin/language_kana.h b/Marlin/language_kana.h index 8022ac248..7925adbd0 100644 --- a/Marlin/language_kana.h +++ b/Marlin/language_kana.h @@ -157,8 +157,8 @@ #define MSG_FILAMENT_DIAM "\xcc\xa8\xd7\xd2\xdd\xc4\xb9\xb2" // "フィラメントケイ" ("Fil. Dia.") #endif #define MSG_CONTRAST "LCD\xba\xdd\xc4\xd7\xbd\xc4" // "LCDコントラスト" ("LCD contrast") -#define MSG_STORE_EPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory") -#define MSG_LOAD_EPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\xba\xd0" // "メモリカラヨミコミ" ("Load memory") +#define MSG_STORE_EEPROM "\xd2\xd3\xd8\xcd\xb6\xb8\xc9\xb3" // "メモリヘカクノウ" ("Store memory") +#define MSG_LOAD_EEPROM "\xd2\xd3\xd8\xb6\xd7\xd6\xd0\xba\xd0" // "メモリカラヨミコミ" ("Load memory") #define MSG_RESTORE_FAILSAFE "\xbe\xaf\xc3\xb2\xd8\xbe\xaf\xc4" // "セッテイリセット" ("Restore failsafe") #define MSG_REFRESH "\xd8\xcc\xda\xaf\xbc\xad" // "リフレッシュ" ("Refresh") #define MSG_WATCH "\xbc\xde\xae\xb3\xce\xb3\xb6\xde\xd2\xdd" // "ジョウホウガメン" ("Info screen") diff --git a/Marlin/language_kana_utf8.h b/Marlin/language_kana_utf8.h index cb0404072..48ffa3738 100644 --- a/Marlin/language_kana_utf8.h +++ b/Marlin/language_kana_utf8.h @@ -128,8 +128,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("フィラメントチョッケイ") // "Fil. Dia." #define MSG_CONTRAST _UxGT("LCDコントラスト") // "LCD contrast" -#define MSG_STORE_EPROM _UxGT("メモリヘカクノウ") // "Store memory" -#define MSG_LOAD_EPROM _UxGT("メモリカラヨミコミ") // "Load memory" +#define MSG_STORE_EEPROM _UxGT("メモリヘカクノウ") // "Store memory" +#define MSG_LOAD_EEPROM _UxGT("メモリカラヨミコミ") // "Load memory" #define MSG_RESTORE_FAILSAFE _UxGT("セッテイリセット") // "Restore failsafe" #define MSG_REFRESH _UxGT("リフレッシュ") // "Refresh" #define MSG_WATCH _UxGT("ジョウホウガメン") // "Info screen" diff --git a/Marlin/language_nl.h b/Marlin/language_nl.h index 5d15a699a..33d385504 100644 --- a/Marlin/language_nl.h +++ b/Marlin/language_nl.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Dia.") #define MSG_CONTRAST _UxGT("LCD contrast") -#define MSG_STORE_EPROM _UxGT("Geheugen opslaan") -#define MSG_LOAD_EPROM _UxGT("Geheugen laden") +#define MSG_STORE_EEPROM _UxGT("Geheugen opslaan") +#define MSG_LOAD_EEPROM _UxGT("Geheugen laden") #define MSG_RESTORE_FAILSAFE _UxGT("Noodstop reset") #define MSG_REFRESH _UxGT("Ververs") #define MSG_WATCH _UxGT("Info scherm") diff --git a/Marlin/language_pl.h b/Marlin/language_pl.h index 6531ad7da..dc08e10e2 100644 --- a/Marlin/language_pl.h +++ b/Marlin/language_pl.h @@ -118,8 +118,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E w mm3") #define MSG_FILAMENT_DIAM _UxGT("Sr. fil.") #define MSG_CONTRAST _UxGT("Kontrast LCD") -#define MSG_STORE_EPROM _UxGT("Zapisz w pamieci") -#define MSG_LOAD_EPROM _UxGT("Wczytaj z pamieci") +#define MSG_STORE_EEPROM _UxGT("Zapisz w pamieci") +#define MSG_LOAD_EEPROM _UxGT("Wczytaj z pamieci") #define MSG_RESTORE_FAILSAFE _UxGT("Ustaw. fabryczne") #define MSG_REFRESH _UxGT("Odswiez") #define MSG_WATCH _UxGT("Ekran glowny") diff --git a/Marlin/language_pt-br.h b/Marlin/language_pt-br.h index 1c83f2167..b6a0778a6 100644 --- a/Marlin/language_pt-br.h +++ b/Marlin/language_pt-br.h @@ -111,8 +111,8 @@ #define MSG_VOLUMETRIC_ENABLED "Extr. em mm3" #define MSG_FILAMENT_DIAM "Diametro Fil." #define MSG_CONTRAST "Contraste" -#define MSG_STORE_EPROM "Salvar" -#define MSG_LOAD_EPROM "Ler" +#define MSG_STORE_EEPROM "Salvar" +#define MSG_LOAD_EEPROM "Ler" #define MSG_RESTORE_FAILSAFE "Rest. de emerg." #define MSG_REFRESH LCD_STR_REFRESH " Restaurar" #define MSG_WATCH "Monitorar" diff --git a/Marlin/language_pt-br_utf8.h b/Marlin/language_pt-br_utf8.h index bed0a8cd7..ece1ff84a 100644 --- a/Marlin/language_pt-br_utf8.h +++ b/Marlin/language_pt-br_utf8.h @@ -111,8 +111,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("Extr. em mm3") #define MSG_FILAMENT_DIAM _UxGT("Diametro Fil.") #define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EPROM _UxGT("Salvar") -#define MSG_LOAD_EPROM _UxGT("Ler") +#define MSG_STORE_EEPROM _UxGT("Salvar") +#define MSG_LOAD_EEPROM _UxGT("Ler") #define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emerg.") #define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Restaurar") #define MSG_WATCH _UxGT("Monitorar") diff --git a/Marlin/language_pt.h b/Marlin/language_pt.h index bb281644e..16a2cb945 100644 --- a/Marlin/language_pt.h +++ b/Marlin/language_pt.h @@ -115,8 +115,8 @@ #define MSG_VOLUMETRIC_ENABLED "E em mm3" #define MSG_FILAMENT_DIAM "Fil. Diam." #define MSG_CONTRAST "Contraste" -#define MSG_STORE_EPROM "Guardar na memoria" -#define MSG_LOAD_EPROM "Carregar da memoria" +#define MSG_STORE_EEPROM "Guardar na memoria" +#define MSG_LOAD_EEPROM "Carregar da memoria" #define MSG_RESTORE_FAILSAFE "Rest. de emergen." #define MSG_REFRESH LCD_STR_REFRESH " Recarregar" #define MSG_WATCH "Monitorizar" diff --git a/Marlin/language_pt_utf8.h b/Marlin/language_pt_utf8.h index 84698f44e..84f95188a 100644 --- a/Marlin/language_pt_utf8.h +++ b/Marlin/language_pt_utf8.h @@ -115,8 +115,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E em mm3") #define MSG_FILAMENT_DIAM _UxGT("Fil. Diam.") #define MSG_CONTRAST _UxGT("Contraste") -#define MSG_STORE_EPROM _UxGT("Guardar na memoria") -#define MSG_LOAD_EPROM _UxGT("Carregar da memoria") +#define MSG_STORE_EEPROM _UxGT("Guardar na memoria") +#define MSG_LOAD_EEPROM _UxGT("Carregar da memoria") #define MSG_RESTORE_FAILSAFE _UxGT("Rest. de emergen.") #define MSG_REFRESH LCD_STR_REFRESH _UxGT(" Recarregar") #define MSG_WATCH _UxGT("Monitorizar") diff --git a/Marlin/language_ru.h b/Marlin/language_ru.h index 9026899a2..caa825cc7 100644 --- a/Marlin/language_ru.h +++ b/Marlin/language_ru.h @@ -115,8 +115,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E в mm3") #define MSG_FILAMENT_DIAM _UxGT("Диаметр прутка") #define MSG_CONTRAST _UxGT("Контраст LCD") -#define MSG_STORE_EPROM _UxGT("Сохранить в EEPROM") -#define MSG_LOAD_EPROM _UxGT("Считать из EEPROM") +#define MSG_STORE_EEPROM _UxGT("Сохранить в EEPROM") +#define MSG_LOAD_EEPROM _UxGT("Считать из EEPROM") #define MSG_RESTORE_FAILSAFE _UxGT("Сброс EEPROM") #define MSG_REFRESH _UxGT("Обновить") #define MSG_WATCH _UxGT("Обзор") diff --git a/Marlin/language_tr.h b/Marlin/language_tr.h index 5df82d4b7..d007a0afb 100644 --- a/Marlin/language_tr.h +++ b/Marlin/language_tr.h @@ -123,8 +123,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E in mm3") // E in mm3 #define MSG_FILAMENT_DIAM _UxGT("Fil. Çap") // Fil. Çap #define MSG_CONTRAST _UxGT("LCD Kontrast") // LCD Kontrast -#define MSG_STORE_EPROM _UxGT("Hafızaya Al") // Hafızaya Al -#define MSG_LOAD_EPROM _UxGT("Hafızadan Yükle") // Hafızadan Yükle +#define MSG_STORE_EEPROM _UxGT("Hafızaya Al") // Hafızaya Al +#define MSG_LOAD_EEPROM _UxGT("Hafızadan Yükle") // Hafızadan Yükle #define MSG_RESTORE_FAILSAFE _UxGT("Fabrika Ayarları") // Fabrika Ayarları #define MSG_REFRESH _UxGT("Yenile") // Yenile #define MSG_WATCH _UxGT("Bilgi Ekranı") // Bilgi Ekranı diff --git a/Marlin/language_uk.h b/Marlin/language_uk.h index a3e1c90f9..4279edc8f 100644 --- a/Marlin/language_uk.h +++ b/Marlin/language_uk.h @@ -119,8 +119,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("E в мм3") #define MSG_FILAMENT_DIAM _UxGT("Діам. волок.") #define MSG_CONTRAST _UxGT("контраст LCD") -#define MSG_STORE_EPROM _UxGT("Зберегти в ПЗП") -#define MSG_LOAD_EPROM _UxGT("Зчитати з ПЗП") +#define MSG_STORE_EEPROM _UxGT("Зберегти в ПЗП") +#define MSG_LOAD_EEPROM _UxGT("Зчитати з ПЗП") #define MSG_RESTORE_FAILSAFE _UxGT("Відновити базові") #define MSG_REFRESH _UxGT("Поновити") #define MSG_WATCH _UxGT("Інформація") diff --git a/Marlin/language_zh_CN.h b/Marlin/language_zh_CN.h index 202ddc55c..41982754e 100644 --- a/Marlin/language_zh_CN.h +++ b/Marlin/language_zh_CN.h @@ -112,8 +112,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("测容积mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("丝料直径") //"Fil. Dia." #define MSG_CONTRAST _UxGT("LCD对比度") //"LCD contrast" -#define MSG_STORE_EPROM _UxGT("保存设置") //"Store memory" -#define MSG_LOAD_EPROM _UxGT("装载设置") //"Load memory" +#define MSG_STORE_EEPROM _UxGT("保存设置") //"Store memory" +#define MSG_LOAD_EEPROM _UxGT("装载设置") //"Load memory" #define MSG_RESTORE_FAILSAFE _UxGT("恢复安全值") //"Restore failsafe" #define MSG_REFRESH _UxGT("刷新") //"Refresh" #define MSG_WATCH _UxGT("信息屏") //"Info screen" diff --git a/Marlin/language_zh_TW.h b/Marlin/language_zh_TW.h index 3ab8f2f50..3d5a03b96 100644 --- a/Marlin/language_zh_TW.h +++ b/Marlin/language_zh_TW.h @@ -112,8 +112,8 @@ #define MSG_VOLUMETRIC_ENABLED _UxGT("測容積mm³") //"E in mm3" volumetric_enabled #define MSG_FILAMENT_DIAM _UxGT("絲料直徑") //"Fil. Dia." #define MSG_CONTRAST _UxGT("LCD對比度") //"LCD contrast" -#define MSG_STORE_EPROM _UxGT("保存設置") //"Store memory" -#define MSG_LOAD_EPROM _UxGT("裝載設置") //"Load memory" +#define MSG_STORE_EEPROM _UxGT("保存設置") //"Store memory" +#define MSG_LOAD_EEPROM _UxGT("裝載設置") //"Load memory" #define MSG_RESTORE_FAILSAFE _UxGT("恢複安全值") //"Restore failsafe" #define MSG_REFRESH _UxGT("刷新") //"Refresh" #define MSG_WATCH _UxGT("資訊界面") //"Info screen" diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 2548e001d..39ab47e32 100755 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -606,6 +606,43 @@ void kill_screen(const char* lcd_msg) { #if ENABLED(ULTIPANEL) + /** + * + * Audio feedback for controller clicks + * + */ + void lcd_buzz(long duration, uint16_t freq) { + #if ENABLED(LCD_USE_I2C_BUZZER) + lcd.buzz(duration, freq); + #elif PIN_EXISTS(BEEPER) + buzzer.tone(duration, freq); + #else + UNUSED(duration); UNUSED(freq); + #endif + } + + void lcd_quick_feedback() { + lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; + buttons = 0; + next_button_update_ms = millis() + 500; + + // Buzz and wait. The delay is needed for buttons to settle! + lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); + #if ENABLED(LCD_USE_I2C_BUZZER) + delay(10); + #elif PIN_EXISTS(BEEPER) + for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } + #endif + } + + void lcd_completion_feedback(const bool good/*=true*/) { + if (good) { + lcd_buzz(100, 659); + lcd_buzz(100, 698); + } + else lcd_buzz(20, 440); + } + inline void line_to_current(AxisEnum axis) { planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); } @@ -1382,10 +1419,7 @@ void kill_screen(const char* lcd_msg) { enqueue_and_echo_commands_P(PSTR("G28")); lcd_return_to_status(); //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE); - #if HAS_BUZZER - lcd_buzz(200, 659); - lcd_buzz(200, 698); - #endif + lcd_completion_feedback(); } else { lcd_goto_screen(_lcd_level_goto_next_point); @@ -1912,6 +1946,16 @@ KeepDrawing: * */ + #if ENABLED(EEPROM_SETTINGS) + static void lcd_store_settings() { lcd_completion_feedback(Config_StoreSettings()); } + static void lcd_load_settings() { lcd_completion_feedback(Config_RetrieveSettings()); } + #endif + + static void lcd_factory_settings() { + Config_ResetDefault(); + lcd_completion_feedback(); + } + void lcd_control_menu() { START_MENU(); MENU_BACK(MSG_MAIN); @@ -1931,10 +1975,11 @@ KeepDrawing: #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); - MENU_ITEM(function, MSG_LOAD_EPROM, Config_RetrieveSettings); + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); + MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings); #endif - MENU_ITEM(function, MSG_RESTORE_FAILSAFE, Config_ResetDefault); + + MENU_ITEM(function, MSG_RESTORE_FAILSAFE, lcd_factory_settings); END_MENU(); } @@ -2175,7 +2220,7 @@ KeepDrawing: MENU_ITEM_EDIT(int3, MSG_BED, &lcd_preheat_bed_temp[material], BED_MINTEMP, BED_MAXTEMP - 15); #endif #if ENABLED(EEPROM_SETTINGS) - MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); + MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings); #endif END_MENU(); } @@ -3003,35 +3048,6 @@ KeepDrawing: #endif // REPRAPWORLD_KEYPAD - /** - * - * Audio feedback for controller clicks - * - */ - void lcd_buzz(long duration, uint16_t freq) { - #if ENABLED(LCD_USE_I2C_BUZZER) - lcd.buzz(duration, freq); - #elif PIN_EXISTS(BEEPER) - buzzer.tone(duration, freq); - #else - UNUSED(duration); UNUSED(freq); - #endif - } - - void lcd_quick_feedback() { - lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; - buttons = 0; - next_button_update_ms = millis() + 500; - - // Buzz and wait. The delay is needed for buttons to settle! - lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); - #if ENABLED(LCD_USE_I2C_BUZZER) - delay(10); - #elif PIN_EXISTS(BEEPER) - for (int8_t i = 5; i--;) { buzzer.tick(); delay(2); } - #endif - } - /** * * Menu actions diff --git a/Marlin/ultralcd.h b/Marlin/ultralcd.h index 8dd2825a3..6b7179902 100644 --- a/Marlin/ultralcd.h +++ b/Marlin/ultralcd.h @@ -78,9 +78,10 @@ #define EN_B (_BV(BLEN_B)) #define EN_C (_BV(BLEN_C)) - extern volatile uint8_t buttons; //the last checked buttons in a bit array. + extern volatile uint8_t buttons; // The last-checked buttons in a bit array. void lcd_buttons_update(); - void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual + void lcd_quick_feedback(); // Audible feedback for a button click - could also be visual + void lcd_completion_feedback(const bool good=true); #if ENABLED(FILAMENT_CHANGE_FEATURE) void lcd_filament_change_show_message(const FilamentChangeMessage message);