From 7cc485ae3e0f88ddf88a112fd4f5c8e64cc11661 Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Wed, 24 May 2023 19:36:20 +0200 Subject: [PATCH] Fix host action commands conflicting with integrated filament sensor --- Marlin/Configuration_adv.h | 2 +- Marlin/src/MarlinCore.cpp | 100 ------------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index fc1d4f2c..15ae5e24 100755 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -4007,7 +4007,7 @@ * Host Prompt Support enables Marlin to use the host for user prompts so * filament runout and other processes can be managed from the host side. */ -//#define HOST_ACTION_COMMANDS +#define HOST_ACTION_COMMANDS #if ENABLED(HOST_ACTION_COMMANDS) #define HOST_PAUSE_M76 // Tell the host to pause in response to M76 #define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 34d8ff39..6a783051 100755 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -252,12 +252,6 @@ #include "tests/marlin_tests.h" #endif -// PATCH START: Knutwurst -#if ENABLED(ANYCUBIC_TOUCHSCREEN) - #include "lcd/extui/knutwurst/anycubic_touchscreen.h" -#endif -// PATCH END: Knutwurst - PGMSTR(M112_KILL_STR, "M112 Shutdown"); MarlinState marlin_state = MF_INITIALIZING; @@ -396,88 +390,6 @@ void startOrResumeJob() { #endif // SDSUPPORT -// PATCH START: Knutwurst -#ifdef ENDSTOP_BEEP -void EndstopBeep() { - static char last_status = ((READ(X_MIN_PIN) << 2) | (READ(Y_MIN_PIN) << 1) | READ(X_MAX_PIN)); - static unsigned char now_status; - - now_status = ((READ(X_MIN_PIN) << 2) | (READ(Y_MIN_PIN) << 1) | READ(X_MAX_PIN)) & 0xff; - - if (now_status 1 - + active_extruder - #endif - ; - #endif - - //action:out_of_filament - #if ENABLED(HOST_PROMPT_SUPPORT) - host_prompt_reason = PROMPT_FILAMENT_RUNOUT; - host_action_prompt_end(); - host_action_prompt_begin(PSTR("FilamentRunout T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - host_action_prompt_show(); - #endif - - const bool run_runout_script = !runout.host_handling; - - #if ENABLED(HOST_ACTION_COMMANDS) - if (run_runout_script - && ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600") - || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - #if ENABLED(ADVANCED_PAUSE_FEATURE) - || strstr(FILAMENT_RUNOUT_SCRIPT, "M25") - #endif - ) - ) { - host_action_paused(false); - } else { - // Legacy Repetier command for use until newer version supports standard dialog - // To be removed later when pause command also triggers dialog - #ifdef ACTION_ON_FILAMENT_RUNOUT - host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif - - host_action_pause(false); - } - SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " "); - SERIAL_CHAR(tool); - SERIAL_EOL(); - #endif // HOST_ACTION_COMMANDS - - if (run_runout_script) { - queue.inject_P(PSTR(FILAMENT_RUNOUT_SCRIPT)); - } - } -#endif // HAS_FILAMENT_SENSOR -// PATCH END: Knutwurst /** * Minimal management of Marlin's core activities: @@ -493,12 +405,6 @@ void EndstopBeep() { * - Pulse FET_SAFETY_PIN if it exists */ inline void manage_inactivity(const bool no_stepper_sleep=false) { - // PATCH START: Knutwurst - #if ENABLED(ANYCUBIC_TOUCHSCREEN) && ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR) - AnycubicTouchscreen.FilamentRunout(); - #endif - // PATCH END: Knutwurst - queue.get_available_commands(); const millis_t ms = millis(); @@ -889,12 +795,6 @@ void idle(bool no_stepper_sleep/*=false*/) { // Max7219 heartbeat, animation, etc TERN_(MAX7219_DEBUG, max7219.idle_tasks()); - // PATCH START: Knutwurst - #ifdef ENDSTOP_BEEP - EndstopBeep(); - #endif - // PATCH END: Knutwurst - // Return if setup() isn't completed if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;