Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ void Endstops::poll() {
run_monitor(); // report changes in endstop status
#endif

#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && ENABLED(ENDSTOP_NOISE_FILTER)
if (endstop_poll_count) update();
#elif DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER)
#if DISABLED(ENDSTOP_INTERRUPTS_FEATURE)
update();
#elif ENABLED(ENDSTOP_NOISE_FILTER)
if (endstop_poll_count) update();
#endif
}

Expand All @@ -275,7 +275,16 @@ void Endstops::not_homing() {
enabled = enabled_globally;

#if ENABLED(ENDSTOP_INTERRUPTS_FEATURE)
update();
// Still 'enabled'? Then endstops are always on and kept in sync.
// Otherwise reset 'live's variables to let axes move in both directions.
if (!enabled) {
#if ENABLED(ENDSTOP_NOISE_FILTER)
endstop_poll_count = validated_live_state = 0; // Stop filtering
#endif
live_state = 0;
}
//#else
// When in polling endstops are always kept in sync
#endif
}

Expand Down Expand Up @@ -666,7 +675,7 @@ void Endstops::update() {
if (triple_hit) { \
_ENDSTOP_HIT(AXIS1, MINMAX); \
/* if not performing home or if both endstops were trigged during homing... */ \
if (!stepper.separate_multi_axis || triple_hit == 0x7) \
if (!stepper.separate_multi_axis || triple_hit == 0b111) \
planner.endstop_triggered(_AXIS(AXIS1)); \
} \
}while(0)
Expand Down
3 changes: 1 addition & 2 deletions Marlin/src/module/endstops.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class Endstops {

public:

static bool enabled, enabled_globally;

#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || Z_MULTI_ENDSTOPS
typedef uint16_t esbits_t;
#if ENABLED(X_DUAL_ENDSTOPS)
Expand All @@ -75,6 +73,7 @@ class Endstops {
#endif

private:
static bool enabled, enabled_globally;
static esbits_t live_state;
static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index

Expand Down