aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/example-extras.cfg7
-rw-r--r--klippy/extruder.py6
2 files changed, 12 insertions, 1 deletions
diff --git a/config/example-extras.cfg b/config/example-extras.cfg
index 34a55d89..ce3af640 100644
--- a/config/example-extras.cfg
+++ b/config/example-extras.cfg
@@ -13,6 +13,13 @@
#step_pin: ar36
#dir_pin: ar34
#...
+#shared_heater:
+# If this extruder uses the same heater already defined for another
+# extruder then place the name of that extruder here. For example,
+# should extruder3 and extruder4 share a heater then the extruder3
+# config section should define the heater and the extruder4 section
+# should specify "shared_heater: extruder3". The default is to not
+# reuse an existing heater.
#deactivate_gcode:
# A list of G-Code commands (one per line) to execute on a G-Code
# tool change command (eg, "T1") that deactivates this extruder and
diff --git a/klippy/extruder.py b/klippy/extruder.py
index a2d4c14b..82c89c47 100644
--- a/klippy/extruder.py
+++ b/klippy/extruder.py
@@ -10,7 +10,11 @@ EXTRUDE_DIFF_IGNORE = 1.02
class PrinterExtruder:
def __init__(self, printer, config):
- self.heater = heater.PrinterHeater(printer, config)
+ shared_heater = config.get('shared_heater', None)
+ if shared_heater is None:
+ self.heater = heater.PrinterHeater(printer, config)
+ else:
+ self.heater = get_printer_heater(printer, shared_heater)
self.stepper = stepper.PrinterStepper(printer, config)
self.nozzle_diameter = config.getfloat('nozzle_diameter', above=0.)
filament_diameter = config.getfloat(