From eaab2dea925f0da5b38fcec1c58e9b8806efbaf8 Mon Sep 17 00:00:00 2001 From: saddfox Date: Mon, 25 Nov 2024 04:52:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Fix/improve=20Sovol=20SV06=20Plu?= =?UTF-8?q?s=20(#27531)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/feature/pause.cpp | 4 ++-- Marlin/src/feature/runout.h | 2 ++ Marlin/src/gcode/host/M115.cpp | 2 +- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 16 ++++++++-------- .../anycubic_i3mega/anycubic_i3mega_lcd.cpp | 8 ++++---- Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp | 12 ++++++++---- .../generic/advanced_settings_menu.cpp | 16 ++++++++-------- .../generic/endstop_state_screen.cpp | 4 ++-- .../ftdi_eve_touch_ui/generic/filament_menu.cpp | 10 +++++----- .../extui/ftdi_eve_touch_ui/generic/screens.h | 8 ++++---- .../ftdi_eve_touch_ui/generic/status_screen.cpp | 8 ++++---- .../lcd/extui/ia_creality/ia_creality_extui.cpp | 4 ++-- .../lcd/extui/ia_creality/ia_creality_rts.cpp | 2 +- Marlin/src/lcd/menu/menu_configuration.cpp | 2 +- Marlin/src/lcd/sovol_rts/sovol_rts.cpp | 12 ++++++------ 15 files changed, 58 insertions(+), 52 deletions(-) diff --git a/Marlin/src/feature/pause.cpp b/Marlin/src/feature/pause.cpp index fd01e85284d3..3589847761c5 100644 --- a/Marlin/src/feature/pause.cpp +++ b/Marlin/src/feature/pause.cpp @@ -219,14 +219,14 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load while (wait_for_user) { impatient_beep(max_beep_count); - #if ALL(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR) + #if ALL(HAS_FILAMENT_SENSOR, FILAMENT_CHANGE_RESUME_ON_INSERT) #if MULTI_FILAMENT_SENSOR #define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break; switch (active_extruder) { REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED) } #else - if (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) wait_for_user = false; + if (!FILAMENT_IS_OUT()) wait_for_user = false; #endif #endif idle_no_sleep(); diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index a152bd1e779e..52a9020830b7 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -51,6 +51,8 @@ #define HAS_FILAMENT_SWITCH 1 #endif +#define FILAMENT_IS_OUT() (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE) + typedef Flags< #if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS NUM_MOTION_SENSORS diff --git a/Marlin/src/gcode/host/M115.cpp b/Marlin/src/gcode/host/M115.cpp index f867aadb05c3..a4a2ac405f57 100644 --- a/Marlin/src/gcode/host/M115.cpp +++ b/Marlin/src/gcode/host/M115.cpp @@ -155,7 +155,7 @@ void GcodeSuite::M115() { cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL)); // RUNOUT (M412, M600) - cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR)); + cap_line(F("RUNOUT"), ENABLED(HAS_FILAMENT_SENSOR)); // Z_PROBE (G30) cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE)); diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 8311fae6a14a..115987b063d9 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -46,7 +46,7 @@ #include "../../../feature/pause.h" #endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#if HAS_FILAMENT_SENSOR #include "../../../feature/runout.h" #endif @@ -2857,7 +2857,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define ADVANCED_LOAD (ADVANCED_LA + ENABLED(ADVANCED_PAUSE_FEATURE)) #define ADVANCED_UNLOAD (ADVANCED_LOAD + ENABLED(ADVANCED_PAUSE_FEATURE)) #define ADVANCED_COLD_EXTRUDE (ADVANCED_UNLOAD + ENABLED(PREVENT_COLD_EXTRUSION)) - #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(FILAMENT_RUNOUT_SENSOR)) + #define ADVANCED_FILSENSORENABLED (ADVANCED_COLD_EXTRUDE + ENABLED(HAS_FILAMENT_SENSOR)) #define ADVANCED_FILSENSORDISTANCE (ADVANCED_FILSENSORENABLED + ENABLED(HAS_FILAMENT_RUNOUT_DISTANCE)) #define ADVANCED_POWER_LOSS (ADVANCED_FILSENSORDISTANCE + ENABLED(POWER_LOSS_RECOVERY)) #define ADVANCED_TOTAL ADVANCED_POWER_LOSS @@ -2953,7 +2953,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR case ADVANCED_FILSENSORENABLED: if (draw) { drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); @@ -2975,7 +2975,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra modifyValue(runout.runout_distance(), 0, 999, 10); break; #endif - #endif // FILAMENT_RUNOUT_SENSOR + #endif // HAS_FILAMENT_SENSOR #if ENABLED(POWER_LOSS_RECOVERY) case ADVANCED_POWER_LOSS: @@ -3830,7 +3830,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra #define TUNE_LA (TUNE_ZDOWN + ENABLED(LIN_ADVANCE)) #define TUNE_CHANGEFIL (TUNE_LA + ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)) #define TUNE_FWRETRACT (TUNE_CHANGEFIL + ENABLED(FWRETRACT)) - #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(FILAMENT_RUNOUT_SENSOR)) + #define TUNE_FILSENSORENABLED (TUNE_FWRETRACT + ENABLED(HAS_FILAMENT_SENSOR)) #define TUNE_BACKLIGHT_OFF (TUNE_FILSENSORENABLED + 1) #define TUNE_BACKLIGHT (TUNE_BACKLIGHT_OFF + 1) #define TUNE_TOTAL TUNE_BACKLIGHT @@ -3950,7 +3950,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra break; #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR case TUNE_FILSENSORENABLED: if (draw) { drawMenuItem(row, ICON_Extruder, GET_TEXT_F(MSG_RUNOUT_SENSOR)); @@ -4326,7 +4326,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/) case Popup_FilLoad: drawPopup(option ? F("Unloading Filament") : F("Loading Filament"), PWID, F(""), Proc_Wait, ICON_BLTouch); break; case Popup_FilChange: drawPopup(F("Filament Change"), F("Please wait for prompt."), F(""), Proc_Wait, ICON_BLTouch); break; case Popup_TempWarn: drawPopup(option ? F("Nozzle temp too low!") : F("Nozzle temp too high!"), F(""), F(""), Proc_Wait, option ? ICON_TempTooLow : ICON_TempTooHigh); break; - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR case Popup_Runout: drawPopup(F("Filament Runout"), F(""), F(""), Proc_Wait, ICON_BLTouch); break; #endif #if ANY(PIDTEMP, PIDTEMPBED) @@ -4953,7 +4953,7 @@ void JyersDWIN::stateUpdate() { } } #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR static bool ranout = false; if (runout.filament_ran_out != ranout) { ranout = runout.filament_ran_out; diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp index 66792ce5ca4a..8930cc37c2da 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp @@ -89,7 +89,7 @@ void AnycubicTFT::onSetup() { delay_ms(10); // Init the state of the key pins running on the TFT - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR SET_INPUT_PULLUP(FIL_RUNOUT1_PIN); #endif @@ -894,7 +894,7 @@ void AnycubicTFT::doSDCardStateCheck() { } void AnycubicTFT::doFilamentRunoutCheck() { - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR // NOTE: getFilamentRunoutState() only returns the runout state if the job is printing // we want to actually check the status of the pin here, regardless of printstate if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { @@ -909,7 +909,7 @@ void AnycubicTFT::doFilamentRunoutCheck() { SENDLINE_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15"); } } - #endif // FILAMENT_RUNOUT_SENSOR + #endif // HAS_FILAMENT_SENSOR } void AnycubicTFT::startPrint() { @@ -939,7 +939,7 @@ void AnycubicTFT::pausePrint() { void AnycubicTFT::resumePrint() { #if HAS_MEDIA - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) { DEBUG_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... "); diff --git a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp index ef9452a9db85..f67b0930c18d 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp @@ -45,6 +45,10 @@ #include "../../../feature/powerloss.h" #endif +#if HAS_FILAMENT_SENSOR + #include "../../../feature/runout.h" +#endif + #define DEBUG_OUT ACDEBUGLEVEL #include "../../../core/debug_out.h" @@ -438,7 +442,7 @@ namespace Anycubic { } } - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR void DgusTFT::filamentRunout() { #if ACDEBUG(AC_MARLIN) @@ -453,7 +457,7 @@ namespace Anycubic { pop_up_index = 15; // show filament lack. - if (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE) { + if (FILAMENT_IS_OUT()) { playTune(FilamentOut); feedrate_back = getFeedrate_percent(); @@ -466,7 +470,7 @@ namespace Anycubic { } } - #endif // FILAMENT_RUNOUT_SENSOR + #endif // HAS_FILAMENT_SENSOR void DgusTFT::confirmationRequest(const char * const msg) { // M108 continue @@ -598,7 +602,7 @@ namespace Anycubic { printer_state = AC_printer_stopping_from_media_remove; } else { - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR #if ACDEBUG(AC_MARLIN) DEBUG_ECHOLNPGM("setFilamentRunoutState: ", __LINE__); #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp index e4cf0b379ca2..ab7d38599dd8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/advanced_settings_menu.cpp @@ -102,7 +102,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) { #endif .enabled(ENABLED(HAS_MULTI_HOTEND)) .tag(4) .button(OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU)) - .enabled(ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)) + .enabled(ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)) .tag(11).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT)) .tag(12).button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS)) .tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU)) @@ -122,29 +122,29 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) { switch (tag) { case 1: SaveSettingsDialogBox::promptToSaveSettings(); break; #if HAS_BED_PROBE - case 2: GOTO_SCREEN(ZOffsetScreen); break; + case 2: GOTO_SCREEN(ZOffsetScreen); break; #endif case 3: GOTO_SCREEN(StepsScreen); break; #if HAS_MULTI_HOTEND - case 4: GOTO_SCREEN(NozzleOffsetScreen); break; + case 4: GOTO_SCREEN(NozzleOffsetScreen); break; #endif case 5: GOTO_SCREEN(MaxVelocityScreen); break; case 6: GOTO_SCREEN(DefaultAccelerationScreen); break; case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break; #if ENABLED(BACKLASH_GCODE) - case 8: GOTO_SCREEN(BacklashCompensationScreen); break; + case 8: GOTO_SCREEN(BacklashCompensationScreen); break; #endif case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break; case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break; - #if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) - case 11: GOTO_SCREEN(FilamentMenu); break; + #if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR) + case 11: GOTO_SCREEN(FilamentMenu); break; #endif case 12: GOTO_SCREEN(EndstopStatesScreen); break; #if HAS_TRINAMIC_CONFIG - case 13: GOTO_SCREEN(StepperCurrentScreen); break; + case 13: GOTO_SCREEN(StepperCurrentScreen); break; #endif #if ENABLED(SENSORLESS_HOMING) - case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break; + case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break; #endif case 15: GOTO_SCREEN(DisplayTuningScreen); break; case 16: GOTO_SCREEN(FlowPercentScreen); break; diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp index 6105591d15dd..8a935313a17b 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/endstop_state_screen.cpp @@ -84,12 +84,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) { #else PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN) #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT) + #if HAS_FILAMENT_SENSOR && PIN_EXISTS(FIL_RUNOUT) PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE) #else PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT) #endif - #if ALL(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) + #if ALL(HAS_MULTI_EXTRUDER, HAS_FILAMENT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2) PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE) #else PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2) diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp index 777698c39860..7883ff71f04e 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp @@ -58,7 +58,7 @@ void FilamentMenu::onRedraw(draw_mode_t what) { cmd.font(font_large) .text(TITLE_POS, GET_TEXT_F(MSG_FILAMENT)) .font(font_medium).colors(normal_btn) - .enabled(ENABLED(FILAMENT_RUNOUT_SENSOR)) + .enabled(ENABLED(HAS_FILAMENT_SENSOR)) .tag(2).button(RUNOUT_SENSOR_POS, GET_TEXT_F(MSG_RUNOUT_SENSOR)) .enabled(ENABLED(LIN_ADVANCE)) .tag(3).button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE)) @@ -69,12 +69,12 @@ void FilamentMenu::onRedraw(draw_mode_t what) { bool FilamentMenu::onTouchEnd(uint8_t tag) { switch (tag) { - case 1: GOTO_PREVIOUS(); break; - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - case 2: GOTO_SCREEN(FilamentRunoutScreen); break; + case 1: GOTO_PREVIOUS(); break; + #if HAS_FILAMENT_SENSOR + case 2: GOTO_SCREEN(FilamentRunoutScreen); break; #endif #if ENABLED(LIN_ADVANCE) - case 3: GOTO_SCREEN(LinearAdvanceScreen); break; + case 3: GOTO_SCREEN(LinearAdvanceScreen); break; #endif default: return false; } diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h index a95932a88001..dcfaa5f9d9a4 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h @@ -75,13 +75,13 @@ enum { #if ENABLED(CASE_LIGHT_ENABLE) CASE_LIGHT_SCREEN_CACHE, #endif - #if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) + #if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR) FILAMENT_MENU_CACHE, #endif #if ENABLED(LIN_ADVANCE) LINEAR_ADVANCE_SCREEN_CACHE, #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR FILAMENT_RUNOUT_SCREEN_CACHE, #endif #if HAS_MEDIA @@ -197,11 +197,11 @@ enum { #include "case_light_screen.h" #endif -#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR) +#if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR) #include "filament_menu.h" #endif -#if ENABLED(FILAMENT_RUNOUT_SENSOR) +#if HAS_FILAMENT_SENSOR #include "filament_runout_screen.h" #endif diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp index 6d5ef85aa3e1..420758ca88a8 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/status_screen.cpp @@ -374,9 +374,9 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) { .button(TOOL_HEAD_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_BUTTON_PAUSE) : GET_TEXT_F(MSG_BUTTON_RESUME)) .tag(!ExtUI::isPrintingPaused() ? 7 : 14) .button(CHANGE_FILAMENT_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_SPEED) : F("")); - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR)); - #endif + #if HAS_FILAMENT_SENSOR + cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR)); + #endif if (ExtUI::isPrintingPaused()) draw_text_box(cmd, CHANGE_FILAMENT_POS, F("Change\nFilament"), OPT_CENTER, font_medium); } @@ -536,7 +536,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) { } break; case 7: GOTO_SCREEN(FeedratePercentScreen); break; - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR case 8: GOTO_SCREEN(FilamentRunoutScreen); break; #endif case 9: injectCommands(F("G28")); break; diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp index 4fb974da2308..0a1c3f6e2c3d 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp @@ -171,7 +171,7 @@ void onUserConfirmRequired(const char *const msg) { case PAUSE_MESSAGE_PURGE: { rts.sendData(ExchangePageBase + 78, ExchangepageAddr); char newMsg[40] = "Yes to "; - strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); + strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, PSTR(" No to Purge")); onStatusChanged(newMsg); break; @@ -181,7 +181,7 @@ void onUserConfirmRequired(const char *const msg) { case PAUSE_MESSAGE_OPTION: { rts.sendData(ExchangePageBase + 78, ExchangepageAddr); char newMsg[40] = "Yes to "; - strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); + strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable ")); strcat_P(newMsg, PSTR(" No to Purge")); onStatusChanged(newMsg); break; diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp index 00249ff08fa8..0c9f8a2e340f 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp @@ -1435,7 +1435,7 @@ void RTS::handleData() { // pause_resume_selected = true; } else { - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR bool runouton = false; if (getFilamentRunoutState()) { #if NUM_RUNOUT_SENSORS > 1 diff --git a/Marlin/src/lcd/menu/menu_configuration.cpp b/Marlin/src/lcd/menu/menu_configuration.cpp index 632c75629dba..e0e8ca4dd03d 100644 --- a/Marlin/src/lcd/menu/menu_configuration.cpp +++ b/Marlin/src/lcd/menu/menu_configuration.cpp @@ -138,7 +138,7 @@ void menu_advanced_settings(); #if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING __STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE); #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) + #if HAS_FILAMENT_SENSOR REPEAT_1(NUM_RUNOUT_SENSORS, FIL_ITEM) #endif diff --git a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp index 89e229d7d5bc..13db7452bc3a 100644 --- a/Marlin/src/lcd/sovol_rts/sovol_rts.cpp +++ b/Marlin/src/lcd/sovol_rts/sovol_rts.cpp @@ -55,7 +55,7 @@ RTS rts; #include "../../feature/tmc_util.h" #include "../../gcode/queue.h" #include "../../gcode/gcode.h" -//#include "../marlinui.h" +#include "../marlinui.h" //#include "../utf8.h" #include "../../libs/BL24CXX.h" @@ -118,7 +118,7 @@ char commandbuf[30]; static SovolPage change_page_number = ID_Startup; -uint16_t remain_time = 0; +uint32_t remain_time = 0; static bool last_card_insert_st; bool card_insert_st; @@ -1365,7 +1365,7 @@ void RTS::handleData() { #if HAS_FILAMENT_SENSOR case FilamentChange: // Automatic material switch (recdat.data[0]) { - case 1: if (runout.filament_ran_out) break; + case 1: if (FILAMENT_IS_OUT()) break; case 2: updateTempE0(); wait_for_heatup = wait_for_user = false; @@ -1530,7 +1530,7 @@ void RTS::handleData() { updateFan0(); - job_percent = card.percentDone() + 1; + job_percent = ui.get_progress_percent(); if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP); sendData(uint8_t(card.percentDone()), PRINT_PROCESS_VP); @@ -1626,13 +1626,13 @@ void RTS::onIdle() { if (card.isPrinting() && (last_cardpercentValue != card.percentDone())) { if (card.percentDone() > 0) { - job_percent = card.percentDone(); + job_percent = ui.get_progress_percent(); if (job_percent <= 100) sendData(uint8_t(job_percent), PRINT_PROCESS_ICON_VP); // Estimate remaining time every 20 seconds static millis_t next_remain_time_update = 0; if (ELAPSED(ms, next_remain_time_update)) { if (thermalManager.degHotend(0) >= thermalManager.degTargetHotend(0) - 5) { - remain_time = elapsed.value / (job_percent * 0.01f) - elapsed.value; + remain_time = ui.get_remaining_time(); next_remain_time_update += 20 * 1000UL; sendData(remain_time / 3600, PRINT_SURPLUS_TIME_HOUR_VP); sendData((remain_time % 3600) / 60, PRINT_SURPLUS_TIME_MIN_VP);