Skip to content

Commit

Permalink
🔧 Permit extrude without hotend (MarlinFirmware#25709)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
  • Loading branch information
ellensp and thinkyhead authored Apr 22, 2023
1 parent 89ccede commit c8ed795
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 214 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 102: M102(); break; // M102: Configure Bed Distance Sensor
#endif

#if HAS_EXTRUDERS
#if HAS_HOTEND
case 104: M104(); break; // M104: Set hot end temperature
case 109: M109(); break; // M109: Wait for hotend temperature to reach target
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ class GcodeSuite {
static void M102_report(const bool forReplay=true);
#endif

#if HAS_EXTRUDERS
#if HAS_HOTEND
static void M104_M109(const bool isM109);
FORCE_INLINE static void M104() { M104_M109(false); }
FORCE_INLINE static void M109() { M104_M109(true); }
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/temp/M104_M109.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "../../inc/MarlinConfigPre.h"

#if HAS_EXTRUDERS
#if HAS_HOTEND

#include "../gcode.h"
#include "../../module/temperature.h"
Expand Down Expand Up @@ -135,4 +135,4 @@ void GcodeSuite::M104_M109(const bool isM109) {
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
}

#endif // EXTRUDERS
#endif // HAS_HOTEND
83 changes: 40 additions & 43 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,6 @@
#undef MIXING_EXTRUDER
#undef HOTEND_IDLE_TIMEOUT
#undef DISABLE_E
#undef THERMAL_PROTECTION_HOTENDS
#undef PREVENT_COLD_EXTRUSION
#undef PREVENT_LENGTHY_EXTRUDE
#undef FILAMENT_RUNOUT_SENSOR
#undef FILAMENT_RUNOUT_DISTANCE_MM
Expand Down Expand Up @@ -657,9 +655,6 @@
#else
#define E_STEPPERS 1
#endif
#if !HAS_SWITCHING_NOZZLE
#define HOTENDS E_STEPPERS
#endif

#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally

Expand Down Expand Up @@ -691,23 +686,53 @@
#define SINGLENOZZLE
#endif

#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // One hotend, one thermistor, no XY offset
#undef HOTENDS
#define HOTENDS 1
#undef HOTEND_OFFSET_X
#undef HOTEND_OFFSET_Y
#endif

#ifndef HOTENDS
#define HOTENDS EXTRUDERS
#endif
// Default E steppers / manual motion is one per extruder
#ifndef E_STEPPERS
#define E_STEPPERS EXTRUDERS
#endif
#ifndef E_MANUAL
#define E_MANUAL EXTRUDERS
#endif

// Number of hotends...
#if EITHER(SINGLENOZZLE, MIXING_EXTRUDER) // Only one for singlenozzle or mixing extruder
#define HOTENDS 1
#elif HAS_SWITCHING_EXTRUDER && !HAS_SWITCHING_NOZZLE // One for each pair of abstract "extruders"
#define HOTENDS E_STEPPERS
#elif TEMP_SENSOR_0
#define HOTENDS EXTRUDERS // One per extruder if at least one heater exists
#else
#define HOTENDS 0 // A machine with no hotends at all can still extrude
#endif

// More than one hotend...
#if HOTENDS > 1
#define HAS_MULTI_HOTEND 1
#define HAS_HOTEND_OFFSET 1
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Y
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Z
#define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
#endif
#else
#undef HOTEND_OFFSET_X
#undef HOTEND_OFFSET_Y
#undef HOTEND_OFFSET_Z
#endif

// At least one hotend...
#if HOTENDS
#define HAS_HOTEND 1
#ifndef HOTEND_OVERSHOOT
#define HOTEND_OVERSHOOT 15
#endif
#endif

// Clean up E-stepper-based settings...
#if E_STEPPERS <= 7
#undef INVERT_E7_DIR
#undef E7_DRIVER_TYPE
Expand Down Expand Up @@ -1037,19 +1062,6 @@
#define E_INDEX_N(E) 0
#endif

#if HOTENDS
#define HAS_HOTEND 1
#ifndef HOTEND_OVERSHOOT
#define HOTEND_OVERSHOOT 15
#endif
#if HOTENDS > 1
#define HAS_MULTI_HOTEND 1
#define HAS_HOTEND_OFFSET 1
#endif
#else
#undef PID_PARAMS_PER_HOTEND
#endif

// Helper macros for extruder and hotend arrays
#define _EXTRUDER_LOOP(E) for (int8_t E = 0; E < EXTRUDERS; E++)
#define EXTRUDER_LOOP() _EXTRUDER_LOOP(e)
Expand All @@ -1061,21 +1073,6 @@
#define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V)
#define ARRAY_BY_HOTENDS1(v1) ARRAY_N_1(HOTENDS, v1)

/**
* Default hotend offsets, if not defined
*/
#if HAS_HOTEND_OFFSET
#ifndef HOTEND_OFFSET_X
#define HOTEND_OFFSET_X { 0 } // X offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Y
#define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder
#endif
#ifndef HOTEND_OFFSET_Z
#define HOTEND_OFFSET_Z { 0 } // Z offsets for each extruder
#endif
#endif

/**
* Disable unused SINGLENOZZLE sub-options
*/
Expand Down
Loading

0 comments on commit c8ed795

Please sign in to comment.