From d545469e3203a7bd6d2068f5ac8cf39ff08fa257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 4 Aug 2023 17:48:49 +0000 Subject: [PATCH] Fix and optimise VERBOSE_CHECK_HIT_ENDSTOPS --- Firmware/stepper.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index 002372743..2312fbfb8 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -189,20 +189,17 @@ void checkHitEndstops() { if(endstop_hit) { #ifdef VERBOSE_CHECK_HIT_ENDSTOPS - SERIAL_ECHO_START; - SERIAL_ECHORPGM(MSG_ENDSTOPS_HIT); - if(endstop_hit & _BV(X_AXIS)) { - SERIAL_ECHOPAIR(" X:",(float)endstops_trigsteps[X_AXIS]/cs.axis_steps_per_mm[X_AXIS]); -// LCD_MESSAGERPGM(CAT2((MSG_ENDSTOPS_HIT), PSTR("X"))); - } - if(endstop_hit & _BV(Y_AXIS)) { - SERIAL_ECHOPAIR(" Y:",(float)endstops_trigsteps[Y_AXIS]/cs.axis_steps_per_mm[Y_AXIS]); -// LCD_MESSAGERPGM(CAT2((MSG_ENDSTOPS_HIT), PSTR("Y"))); - } - if(endstop_hit & _BV(Z_AXIS)) { - SERIAL_ECHOPAIR(" Z:",(float)endstops_trigsteps[Z_AXIS]/cs.axis_steps_per_mm[Z_AXIS]); -// LCD_MESSAGERPGM(CAT2((MSG_ENDSTOPS_HIT),PSTR("Z"))); - } + SERIAL_ECHO_START; + SERIAL_ECHORPGM(PSTR("Endstops Hit")); + for (uint8_t axis = 0; axis < E_AXIS; axis++) // XYZ + { + if(endstop_hit & _BV(axis)) { + SERIAL_ECHO(' '); + SERIAL_ECHO(char('X' + axis)); + SERIAL_ECHO(':'); + SERIAL_ECHO(float(endstops_trigsteps[axis]) / cs.axis_steps_per_mm[axis]); + } + } SERIAL_ECHOLN(""); #endif //VERBOSE_CHECK_HIT_ENDSTOPS endstop_hit = 0;