|
@@ -216,7 +216,7 @@ void Endstops::init() {
|
216
|
216
|
|
217
|
217
|
} // Endstops::init
|
218
|
218
|
|
219
|
|
-// Called from ISR: Poll endstop state if required
|
|
219
|
+// Called at ~1KHz from Temperature ISR: Poll endstop state if required
|
220
|
220
|
void Endstops::poll() {
|
221
|
221
|
|
222
|
222
|
#if ENABLED(PINS_DEBUGGING)
|
|
@@ -258,8 +258,8 @@ void Endstops::not_homing() {
|
258
|
258
|
|
259
|
259
|
// If the last move failed to trigger an endstop, call kill
|
260
|
260
|
void Endstops::validate_homing_move() {
|
261
|
|
- if (!trigger_state()) kill(PSTR(MSG_ERR_HOMING_FAILED));
|
262
|
|
- hit_on_purpose();
|
|
261
|
+ if (trigger_state()) hit_on_purpose();
|
|
262
|
+ else kill(PSTR(MSG_ERR_HOMING_FAILED));
|
263
|
263
|
}
|
264
|
264
|
|
265
|
265
|
// Enable / disable endstop z-probe checking
|
|
@@ -283,8 +283,9 @@ void Endstops::validate_homing_move() {
|
283
|
283
|
}
|
284
|
284
|
#endif
|
285
|
285
|
|
286
|
|
-void Endstops::report_state() {
|
287
|
|
- if (hit_state) {
|
|
286
|
+void Endstops::event_handler() {
|
|
287
|
+ static uint8_t prev_hit_state; // = 0
|
|
288
|
+ if (hit_state && hit_state != prev_hit_state) {
|
288
|
289
|
#if ENABLED(ULTRA_LCD)
|
289
|
290
|
char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' ';
|
290
|
291
|
#define _SET_STOP_CHAR(A,C) (chr## A = C)
|
|
@@ -320,8 +321,6 @@ void Endstops::report_state() {
|
320
|
321
|
lcd_status_printf_P(0, PSTR(MSG_LCD_ENDSTOPS " %c %c %c %c"), chrX, chrY, chrZ, chrP);
|
321
|
322
|
#endif
|
322
|
323
|
|
323
|
|
- hit_on_purpose();
|
324
|
|
-
|
325
|
324
|
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) && ENABLED(SDSUPPORT)
|
326
|
325
|
if (planner.abort_on_endstop_hit) {
|
327
|
326
|
card.sdprinting = false;
|
|
@@ -331,6 +330,7 @@ void Endstops::report_state() {
|
331
|
330
|
}
|
332
|
331
|
#endif
|
333
|
332
|
}
|
|
333
|
+ prev_hit_state = hit_state;
|
334
|
334
|
} // Endstops::report_state
|
335
|
335
|
|
336
|
336
|
void Endstops::M119() {
|
|
@@ -392,7 +392,7 @@ void Endstops::M119() {
|
392
|
392
|
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
|
393
|
393
|
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
|
394
|
394
|
|
395
|
|
-// Check endstops - Could be called from ISR!
|
|
395
|
+// Check endstops - Could be called from Temperature ISR!
|
396
|
396
|
void Endstops::update() {
|
397
|
397
|
|
398
|
398
|
#if DISABLED(ENDSTOP_NOISE_FILTER)
|
|
@@ -567,7 +567,7 @@ void Endstops::update() {
|
567
|
567
|
if (dual_hit) { \
|
568
|
568
|
_ENDSTOP_HIT(AXIS1, MINMAX); \
|
569
|
569
|
/* if not performing home or if both endstops were trigged during homing... */ \
|
570
|
|
- if (!stepper.homing_dual_axis || dual_hit == 0x3) \
|
|
570
|
+ if (!stepper.homing_dual_axis || dual_hit == 0b11) \
|
571
|
571
|
planner.endstop_triggered(_AXIS(AXIS1)); \
|
572
|
572
|
} \
|
573
|
573
|
}while(0)
|