Optional HOST_STATUS_NOTIFICATIONS (#22833)

This commit is contained in:
Taylor Talkington
2022-02-08 18:36:06 -05:00
committed by Scott Lahteine
parent 973366e6aa
commit b964d2fff0
9 changed files with 55 additions and 17 deletions

View File

@ -43,7 +43,6 @@ Stopwatch print_job_timer; // Global Print Job Timer instance
#if PRINTCOUNTER_SYNC
#include "../module/planner.h"
#warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
#endif
// Service intervals

View File

@ -80,6 +80,10 @@
#include "../lcd/e3v2/jyersui/dwin.h"
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
#include "../feature/host_actions.h"
#endif
#if HAS_SERVOS
#include "servo.h"
#endif
@ -652,6 +656,10 @@ void MarlinSettings::postprocess() {
#define DEBUG_OUT EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE)
#include "../core/debug_out.h"
#if BOTH(EEPROM_CHITCHAT, HOST_PROMPT_SUPPORT)
#define HOST_EEPROM_CHITCHAT 1
#endif
#if ENABLED(EEPROM_SETTINGS)
#define EEPROM_ASSERT(TST,ERR) do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = true; } }while(0)
@ -1554,7 +1562,10 @@ void MarlinSettings::postprocess() {
store_mesh(ubl.storage_slot);
#endif
if (!eeprom_error) LCD_MESSAGE(MSG_SETTINGS_STORED);
if (!eeprom_error) {
LCD_MESSAGE(MSG_SETTINGS_STORED);
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_SETTINGS_STORED)));
}
TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error));
@ -1578,6 +1589,7 @@ void MarlinSettings::postprocess() {
}
DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION));
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION)));
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version());
eeprom_error = true;
@ -2468,12 +2480,14 @@ void MarlinSettings::postprocess() {
eeprom_error = true;
DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_CRC));
TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC)));
IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc());
}
else if (!validating) {
DEBUG_ECHO_START();
DEBUG_ECHO(version);
DEBUG_ECHOLNPGM(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET), " bytes; crc ", (uint32_t)working_crc, ")");
TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(F("Stored settings retrieved")));
}
if (!validating && !eeprom_error) postprocess();
@ -2783,7 +2797,6 @@ void MarlinSettings::reset() {
#endif
#endif
TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_SetDataDefaults());
TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Reset_Settings());
@ -3142,7 +3155,11 @@ void MarlinSettings::reset() {
postprocess();
DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded");
FSTR_P const hdsl = F("Hardcoded Default Settings Loaded");
TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(hdsl));
DEBUG_ECHO_START(); DEBUG_ECHOLNF(hdsl);
TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
}
#if DISABLED(DISABLE_M503)

View File

@ -629,6 +629,7 @@ volatile bool Temperature::raw_temps_ready = false;
SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)));
return;
}
@ -719,6 +720,7 @@ volatile bool Temperature::raw_temps_ready = false;
SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)));
break;
}
@ -756,12 +758,14 @@ volatile bool Temperature::raw_temps_ready = false;
TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0));
TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TUNING_TIMEOUT));
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT));
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT)));
SERIAL_ECHOLNPGM(STR_PID_TIMEOUT);
break;
}
if (cycles > ncycles && cycles > 2) {
SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED);
TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)));
#if EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR));