mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-03-02 12:57:08 +00:00
🩹 Endstops prelim. followup
This commit is contained in:
parent
12d8108fc6
commit
99a9e265b0
3 changed files with 6 additions and 3 deletions
Marlin/src/module
|
@ -311,7 +311,7 @@ void Endstops::event_handler() {
|
||||||
SERIAL_ECHOPGM(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); _SET_STOP_CHAR(A,C); }while(0)
|
SERIAL_ECHOPGM(" " STRINGIFY(A) ":", planner.triggered_position_mm(_AXIS(A))); _SET_STOP_CHAR(A,C); }while(0)
|
||||||
|
|
||||||
#define _ENDSTOP_HIT_TEST(A,C) \
|
#define _ENDSTOP_HIT_TEST(A,C) \
|
||||||
if (TERN0(HAS_##A##_MIN, TEST(hit_state, A##_MIN)) || TERN0(HAS_##A##_MAX, TEST(hit_state, A##_MAX))) \
|
if (TERN0(USE_##A##_MIN, TEST(hit_state, ES_ENUM(A,MIN))) || TERN0(USE_##A##_MAX, TEST(hit_state, ES_ENUM(A,MAX)))) \
|
||||||
_ENDSTOP_HIT_ECHO(A,C)
|
_ENDSTOP_HIT_ECHO(A,C)
|
||||||
|
|
||||||
#define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X')
|
#define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X')
|
||||||
|
@ -792,7 +792,7 @@ void Endstops::update() {
|
||||||
}while(0)
|
}while(0)
|
||||||
|
|
||||||
// Core Sensorless Homing needs to test an Extra Pin
|
// Core Sensorless Homing needs to test an Extra Pin
|
||||||
#define CORE_DIAG(QQ,A,MM) (CORE_IS_##QQ && A##_SENSORLESS && !A##_SPI_SENSORLESS && HAS_##A##_##MM)
|
#define CORE_DIAG(QQ,A,MM) (CORE_IS_##QQ && A##_SENSORLESS && !A##_SPI_SENSORLESS && USE_##A##_##MM)
|
||||||
#define PROCESS_CORE_ENDSTOP(A1,M1,A2,M2) do { \
|
#define PROCESS_CORE_ENDSTOP(A1,M1,A2,M2) do { \
|
||||||
if (TEST_ENDSTOP(_ENDSTOP(A1,M1))) { \
|
if (TEST_ENDSTOP(_ENDSTOP(A1,M1))) { \
|
||||||
_ENDSTOP_HIT(A2,M2); \
|
_ENDSTOP_HIT(A2,M2); \
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
#include "../inc/MarlinConfig.h"
|
#include "../inc/MarlinConfig.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#define _ES_ENUM(A,M) A##_##M
|
||||||
|
#define ES_ENUM(A,M) _ES_ENUM(A,M)
|
||||||
|
|
||||||
#define _ES_ITEM(N) N,
|
#define _ES_ITEM(N) N,
|
||||||
#define ES_ITEM(K,N) TERN_(K,DEFER4(_ES_ITEM)(N))
|
#define ES_ITEM(K,N) TERN_(K,DEFER4(_ES_ITEM)(N))
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ xyze_int8_t Stepper::count_direction{0};
|
||||||
#define MINDIR(A) (count_direction[_AXIS(A)] < 0)
|
#define MINDIR(A) (count_direction[_AXIS(A)] < 0)
|
||||||
#define MAXDIR(A) (count_direction[_AXIS(A)] > 0)
|
#define MAXDIR(A) (count_direction[_AXIS(A)] > 0)
|
||||||
|
|
||||||
#define STEPTEST(A,M,I) TERN0(HAS_ ##A## ##I## _ ##M, !(TEST(endstops.state(), A## ##I## _ ##M) && M## DIR(A)) && !locked_ ##A## ##I## _motor)
|
#define STEPTEST(A,M,I) TERN0(USE_##A##I##_##M, !(TEST(endstops.state(), A##I##_##M) && M## DIR(A)) && !locked_ ##A##I##_motor)
|
||||||
|
|
||||||
#define DUAL_ENDSTOP_APPLY_STEP(A,V) \
|
#define DUAL_ENDSTOP_APPLY_STEP(A,V) \
|
||||||
if (separate_multi_axis) { \
|
if (separate_multi_axis) { \
|
||||||
|
|
Loading…
Reference in a new issue