@@ -1939,30 +1939,32 @@ void MarlinUI::init() {
1939
1939
1940
1940
#if DISABLED(EEPROM_AUTO_INIT)
1941
1941
1942
- static inline FSTR_P eeprom_err (const uint8_t msgid) {
1943
- switch (msgid) {
1944
- default :
1945
- case 0 : return GET_TEXT_F (MSG_ERR_EEPROM_CRC);
1946
- case 1 : return GET_TEXT_F (MSG_ERR_EEPROM_INDEX);
1947
- case 2 : return GET_TEXT_F (MSG_ERR_EEPROM_VERSION);
1942
+ static inline FSTR_P eeprom_err (const EEPROM_Error err) {
1943
+ switch (err) {
1944
+ case ERR_EEPROM_VERSION: return GET_TEXT_F (MSG_ERR_EEPROM_VERSION);
1945
+ case ERR_EEPROM_SIZE: return GET_TEXT_F (MSG_ERR_EEPROM_SIZE);
1946
+ case ERR_EEPROM_CRC: return GET_TEXT_F (MSG_ERR_EEPROM_CRC);
1947
+ case ERR_EEPROM_CORRUPT: return GET_TEXT_F (MSG_ERR_EEPROM_CORRUPT);
1948
+ default : return nullptr ;
1948
1949
}
1949
1950
}
1950
1951
1951
- void MarlinUI::eeprom_alert (const uint8_t msgid) {
1952
+ void MarlinUI::eeprom_alert (const EEPROM_Error err) {
1953
+ FSTR_P const err_msg = eeprom_err (err);
1954
+ set_status (err_msg);
1955
+ TERN_ (HOST_PROMPT_SUPPORT, hostui.notify (err_msg));
1952
1956
#if HAS_MARLINUI_MENU
1953
- editable.uint8 = msgid ;
1957
+ editable.uint8 = err ;
1954
1958
goto_screen ([]{
1955
1959
FSTR_P const restore_msg = GET_TEXT_F (MSG_INIT_EEPROM);
1956
1960
char msg[utf8_strlen (restore_msg) + 1 ];
1957
1961
strcpy_P (msg, FTOP (restore_msg));
1958
1962
MenuItem_confirm::select_screen (
1959
1963
GET_TEXT_F (MSG_BUTTON_RESET), GET_TEXT_F (MSG_BUTTON_IGNORE),
1960
1964
init_eeprom, return_to_status,
1961
- eeprom_err (editable.uint8 ), msg, F (" ?" )
1965
+ eeprom_err ((EEPROM_Error) editable.uint8 ), msg, F (" ?" )
1962
1966
);
1963
1967
});
1964
- #else
1965
- set_status (eeprom_err (msgid));
1966
1968
#endif
1967
1969
}
1968
1970
0 commit comments