From 4935191335cd4f30db9e9dd82c535c3c4449a583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 21 Apr 2023 18:43:21 +0000 Subject: [PATCH] Cleanup remove unused macros enable_e1 enable_e2 disable_e1 disable_e2 The firmware doesn't support multiple extruders No change in memory --- Firmware/Marlin.h | 32 -------------------------------- Firmware/Marlin_main.cpp | 22 ++++------------------ Firmware/planner.cpp | 7 +------ Firmware/ultralcd.cpp | 4 ---- 4 files changed, 5 insertions(+), 60 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index d198d406f..c05a27261 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -181,21 +181,6 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_z() disable_force_z() #endif // PSU_Delta - -//#if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 -//#ifdef Z_DUAL_STEPPER_DRIVERS -//#define enable_z() { WRITE(Z_ENABLE_PIN, Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN, Z_ENABLE_ON); } -//#define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); WRITE(Z2_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } -//#else -//#define enable_z() WRITE(Z_ENABLE_PIN, Z_ENABLE_ON) -//#define disable_z() { WRITE(Z_ENABLE_PIN,!Z_ENABLE_ON); axis_known_position[Z_AXIS] = false; } -//#endif -//#else -//#define enable_z() ; -//#define disable_z() ; -//#endif - - #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) #define enable_e0() WRITE(E0_ENABLE_PIN, E_ENABLE_ON) #define disable_e0() WRITE(E0_ENABLE_PIN,!E_ENABLE_ON) @@ -204,23 +189,6 @@ void manage_inactivity(bool ignore_stepper_queue=false); #define disable_e0() /* nothing */ #endif -#if (EXTRUDERS > 1) && defined(E1_ENABLE_PIN) && (E1_ENABLE_PIN > -1) - #define enable_e1() WRITE(E1_ENABLE_PIN, E_ENABLE_ON) - #define disable_e1() WRITE(E1_ENABLE_PIN,!E_ENABLE_ON) -#else - #define enable_e1() /* nothing */ - #define disable_e1() /* nothing */ -#endif - -#if (EXTRUDERS > 2) && defined(E2_ENABLE_PIN) && (E2_ENABLE_PIN > -1) - #define enable_e2() WRITE(E2_ENABLE_PIN, E_ENABLE_ON) - #define disable_e2() WRITE(E2_ENABLE_PIN,!E_ENABLE_ON) -#else - #define enable_e2() /* nothing */ - #define disable_e2() /* nothing */ -#endif - - enum AxisEnum {X_AXIS=0, Y_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5}; #define X_AXIS_MASK 1 #define Y_AXIS_MASK 2 diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 0bdd2b4a5..67e8e86a8 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5269,8 +5269,6 @@ void process_commands() enable_y(); enable_z(); enable_e0(); - enable_e1(); - enable_e2(); break; #ifdef SDSUPPORT @@ -6275,22 +6273,16 @@ Sigma_Exit: { st_synchronize(); disable_e0(); - disable_e1(); - disable_e2(); finishAndDisableSteppers(); } else { st_synchronize(); - if (code_seen('X')) disable_x(); - if (code_seen('Y')) disable_y(); - if (code_seen('Z')) disable_z(); + if (code_seen('X')) disable_x(); + if (code_seen('Y')) disable_y(); + if (code_seen('Z')) disable_z(); #if ((E0_ENABLE_PIN != X_ENABLE_PIN) && (E1_ENABLE_PIN != Y_ENABLE_PIN)) // Only enable on boards that have seperate ENABLE_PINS - if (code_seen('E')) { - disable_e0(); - disable_e1(); - disable_e2(); - } + if (code_seen('E')) disable_e0(); #endif } } @@ -9370,8 +9362,6 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s disable_y(); disable_z(); disable_e0(); - disable_e1(); - disable_e2(); } } } @@ -9459,8 +9449,6 @@ void kill(const char *full_screen_message) { disable_y(); poweroff_z(); disable_e0(); - disable_e1(); - disable_e2(); SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); @@ -9571,8 +9559,6 @@ void finishAndDisableSteppers() disable_y(); disable_z(); disable_e0(); - disable_e1(); - disable_e2(); #ifndef LA_NOCOMPAT // Steppers are disabled both when a print is stopped and also via M84 (which is additionally diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 46b679793..001b2137b 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -554,12 +554,7 @@ void check_axes_activity() if((DISABLE_X) && (x_active == 0)) disable_x(); if((DISABLE_Y) && (y_active == 0)) disable_y(); if((DISABLE_Z) && (z_active == 0)) disable_z(); - if((DISABLE_E) && (e_active == 0)) - { - disable_e0(); - disable_e1(); - disable_e2(); - } + if((DISABLE_E) && (e_active == 0)) disable_e0(); #if defined(FAN_PIN) && FAN_PIN > -1 #ifdef FAN_KICKSTART_TIME static unsigned long fan_kick_end; diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 62eb16971..83239aa9d 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -3188,8 +3188,6 @@ void lcd_temp_cal_show_result(bool result) { disable_y(); disable_z(); disable_e0(); - disable_e1(); - disable_e2(); setTargetBed(0); //set bed target temperature back to 0 // Store boolean result @@ -4947,8 +4945,6 @@ void unload_filament(float unloadLength) //disable extruder steppers so filament can be removed disable_e0(); - disable_e1(); - disable_e2(); _delay(100); Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);