Skip to content

Commit

Permalink
Add analogous feature for Prusa-firmware's M862.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmirate authored Mar 15, 2022
1 parent 55ee64c commit 61353e9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ gcode:
# Park
G0 X{safe_x} Y{y} F{speed}

[gcode_macro ASSERT_NOZZLE_DIAMETER]
gcode:
{% set expected_diameter = params.NOZZLE_DIAMETER|float %}
{% set actual_diameter = printer.configfile.config.extruder.nozzle_diameter|float %}
{% if expected_diameter != actual_diameter %}
M117 Aborting print due to nozzle-diameter mismatch between printer config and slicer.
{ action_raise_error("Nozzle-diameter mismatch between printer config (%s mm) and slicer (%s mm)." % (expected_diameter, actual_diameter)) }
{% endif %}

#####
# COLOR CHANGE
#####
Expand Down Expand Up @@ -256,6 +265,10 @@ gcode:
M82
# Home
G28
# Check nozzle if told to do so
{% if params.NOZZLE_DIAMETER %}
ASSERT_NOZZLE_DIAMETER NOZZLE_DIAMETER={params.NOZZLE_DIAMETER}
{% endif %}
M117 Heating bed...
# Wait for bed to heat up
M190 S{params.BED_TEMP|default(printer.heater_bed.target, true) }
Expand Down

0 comments on commit 61353e9

Please sign in to comment.