@@ -1899,30 +1899,32 @@ void MarlinUI::init() {
1899
1899
1900
1900
#if DISABLED(EEPROM_AUTO_INIT)
1901
1901
1902
- static inline FSTR_P eeprom_err (const uint8_t msgid) {
1903
- switch (msgid) {
1904
- default :
1905
- case 0 : return GET_TEXT_F (MSG_ERR_EEPROM_CRC);
1906
- case 1 : return GET_TEXT_F (MSG_ERR_EEPROM_INDEX);
1907
- case 2 : return GET_TEXT_F (MSG_ERR_EEPROM_VERSION);
1902
+ static inline FSTR_P eeprom_err (const EEPROM_Error err) {
1903
+ switch (err) {
1904
+ case ERR_EEPROM_VERSION: return GET_TEXT_F (MSG_ERR_EEPROM_VERSION);
1905
+ case ERR_EEPROM_SIZE: return GET_TEXT_F (MSG_ERR_EEPROM_SIZE);
1906
+ case ERR_EEPROM_CRC: return GET_TEXT_F (MSG_ERR_EEPROM_CRC);
1907
+ case ERR_EEPROM_CORRUPT: return GET_TEXT_F (MSG_ERR_EEPROM_CORRUPT);
1908
+ default : return nullptr ;
1908
1909
}
1909
1910
}
1910
1911
1911
- void MarlinUI::eeprom_alert (const uint8_t msgid) {
1912
+ void MarlinUI::eeprom_alert (const EEPROM_Error err) {
1913
+ FSTR_P const err_msg = eeprom_err (err);
1914
+ set_status (err_msg);
1915
+ TERN_ (HOST_PROMPT_SUPPORT, hostui.notify (err_msg));
1912
1916
#if HAS_MARLINUI_MENU
1913
- editable.uint8 = msgid ;
1917
+ editable.uint8 = err ;
1914
1918
goto_screen ([]{
1915
1919
FSTR_P const restore_msg = GET_TEXT_F (MSG_INIT_EEPROM);
1916
1920
char msg[utf8_strlen (restore_msg) + 1 ];
1917
1921
strcpy_P (msg, FTOP (restore_msg));
1918
1922
MenuItem_confirm::select_screen (
1919
1923
GET_TEXT_F (MSG_BUTTON_RESET), GET_TEXT_F (MSG_BUTTON_IGNORE),
1920
1924
init_eeprom, return_to_status,
1921
- eeprom_err (editable.uint8 ), msg, F (" ?" )
1925
+ eeprom_err ((EEPROM_Error) editable.uint8 ), msg, F (" ?" )
1922
1926
);
1923
1927
});
1924
- #else
1925
- set_status (eeprom_err (msgid));
1926
1928
#endif
1927
1929
}
1928
1930
0 commit comments