From 55b1e37a44b0ebae95bf64f5059cb0ea2bc61ff0 Mon Sep 17 00:00:00 2001 From: Mikkel Schmidt Date: Fri, 5 Jan 2024 17:41:17 +0100 Subject: [PATCH] Homing: Fix homing method determination --- homing.cfg | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homing.cfg b/homing.cfg index cbd28c25..513a51a4 100644 --- a/homing.cfg +++ b/homing.cfg @@ -22,9 +22,11 @@ gcode: {% set z_speed = printer["gcode_macro RatOS"].macro_z_speed|float * 60 %} {% set z_hop = printer.configfile.config.ratos_homing.z_hop|float %} {% set z_hop_speed = printer.configfile.config.ratos_homing.z_hop_speed|float * 60 %} + {% set homing = printer["gcode_macro RatOS"].homing|lower %} {% set homing_x = printer["gcode_macro RatOS"].homing_x|lower %} {% set homing_y = printer["gcode_macro RatOS"].homing_y|lower %} - {% set homing = printer["gcode_macro RatOS"].homing|lower %} + {% set homing_x = homing_x if homing_x else homing %} + {% set homing_y = homing_y if homing_y else homing %} {% set prev_stop_on_error = printer["gcode_macro RatOS"].stowable_probe_stop_on_error %} # Make stowable probe assertion failures cause an emergency stop @@ -34,9 +36,9 @@ gcode: G90 # Absolute positioning {% if params.X is defined or params.Y is not defined and params.Z is not defined %} - {% if homing_x == 'endstop' or homing == 'endstops' %} + {% if homing_x == 'endstop' %} G28 X - {% elif homing_x == 'sensorless' or homing == 'sensorless' %} + {% elif homing_x == 'sensorless' %} HOME_X_SENSORLESS {% else %} { action_emergency_stop("expected RatOS variable_homing_x to be 'sensorless' 'endstop' or variable_homing to be 'sensorless' or 'endstops' but found {} and {}".format(homing_x, homing)) } @@ -46,9 +48,9 @@ gcode: {% endif %} {% if params.Y is defined or params.X is not defined and params.Z is not defined %} - {% if homing_y == 'endstop' or homing == 'endstops' %} + {% if homing_y == 'endstop' %} G28 Y - {% elif homing_y == 'sensorless' or homing == 'sensorless' %} + {% elif homing_y == 'sensorless' %} HOME_Y_SENSORLESS {% else %} { action_emergency_stop("expected RatOS variable_homing_y to be 'sensorless' 'endstop' or variable_homing to be 'sensorless' or 'endstops' but found {} and {}".format(homing_y, homing)) }