Skip to content

Commit

Permalink
MACRO: add helper macro INCREASE_Y_MAX (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
HelgeKeck authored Dec 7, 2024
1 parent e5f1665 commit 2367644
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions macros/util.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,20 @@ gcode:
CONSOLE_ECHO TITLE="Copy and paste to your printer.cfg" TYPE="info" MSG={'"%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_%s_N_ "' % (line_1, line_2, line_3, line_4, line_5, line_6, line_7, line_8, line_9, line_10, line_11, line_12)}

{% endif %}


[gcode_macro INCREASE_Y_MAX]
gcode:
{% if printer["dual_carriage"] is defined %}

{% set bed_margin_y = printer["gcode_macro RatOS"].bed_margin_y %}
{% set stepper_y_position_max = printer.configfile.settings.stepper_y.position_max|float %}
{% set stepper_y_position_endstop = printer.configfile.settings.stepper_y.position_endstop|float %}

{% set line_1 = "_N_[stepper_y]" %}
{% set line_2 = "position_max: %.3f" % (stepper_y_position_max + 1) %}
{% set line_3 = "_N_[gcode_macro RatOS]" %}
{% set line_4 = "variable_bed_margin_y: [%.3f, %.3f]" % (stepper_y_position_endstop|abs, (bed_margin_y[1] + 1)) %}
CONSOLE_ECHO TITLE="Copy and paste to your printer.cfg" TYPE="info" MSG={'"%s_N_%s_N_%s_N_%s_N_ "' % (line_1, line_2, line_3, line_4)}

{% endif %}

0 comments on commit 2367644

Please sign in to comment.