[SAMD51] ES Interrupt parity with other HALs (#18836)

This commit is contained in:
Giuliano Zaro 2020-07-29 04:19:46 +02:00 committed by Scott Lahteine
parent 524613b610
commit 796471a7c6

View File

@ -126,82 +126,83 @@
void endstop_ISR() { endstops.update(); } void endstop_ISR() { endstops.update(); }
void setup_endstop_interrupts() { void setup_endstop_interrupts() {
#define _ATTACH(P) attachInterrupt(P, endstop_ISR, CHANGE)
#if HAS_X_MAX #if HAS_X_MAX
#if !AVAILABLE_EILINE(X_MAX_PIN) #if !AVAILABLE_EILINE(X_MAX_PIN)
#error "X_MAX_PIN has no EXTINT line available." #error "X_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(X_MAX_PIN);
#endif #endif
#if HAS_X_MIN #if HAS_X_MIN
#if !AVAILABLE_EILINE(X_MIN_PIN) #if !AVAILABLE_EILINE(X_MIN_PIN)
#error "X_MIN_PIN has no EXTINT line available." #error "X_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(X_MIN_PIN);
#endif #endif
#if HAS_Y_MAX #if HAS_Y_MAX
#if !AVAILABLE_EILINE(Y_MAX_PIN) #if !AVAILABLE_EILINE(Y_MAX_PIN)
#error "Y_MAX_PIN has no EXTINT line available." #error "Y_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(Y_MAX_PIN);
#endif #endif
#if HAS_Y_MIN #if HAS_Y_MIN
#if !AVAILABLE_EILINE(Y_MIN_PIN) #if !AVAILABLE_EILINE(Y_MIN_PIN)
#error "Y_MIN_PIN has no EXTINT line available." #error "Y_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(Y_MIN_PIN);
#endif #endif
#if HAS_Z_MAX #if HAS_Z_MAX
#if !AVAILABLE_EILINE(Z_MAX_PIN) #if !AVAILABLE_EILINE(Z_MAX_PIN)
#error "Z_MAX_PIN has no EXTINT line available." #error "Z_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(Z_MAX_PIN);
#endif #endif
#if HAS_Z_MIN #if HAS_Z_MIN
#if !AVAILABLE_EILINE(Z_MIN_PIN) #if !AVAILABLE_EILINE(Z_MIN_PIN)
#error "Z_MIN_PIN has no EXTINT line available." #error "Z_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(Z_MIN_PIN);
#endif #endif
#if HAS_Z2_MAX #if HAS_Z2_MAX
#if !AVAILABLE_EILINE(Z2_MAX_PIN) #if !AVAILABLE_EILINE(Z2_MAX_PIN)
#error "Z2_MAX_PIN has no EXTINT line available." #error "Z2_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(Z2_MAX_PIN);
#endif #endif
#if HAS_Z2_MIN #if HAS_Z2_MIN
#if !AVAILABLE_EILINE(Z2_MIN_PIN) #if !AVAILABLE_EILINE(Z2_MIN_PIN)
#error "Z2_MIN_PIN has no EXTINT line available." #error "Z2_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(Z2_MIN_PIN);
#endif #endif
#if HAS_Z3_MAX #if HAS_Z3_MAX
#if !AVAILABLE_EILINE(Z3_MAX_PIN) #if !AVAILABLE_EILINE(Z3_MAX_PIN)
#error "Z3_MAX_PIN has no EXTINT line available." #error "Z3_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z3_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(Z3_MAX_PIN);
#endif #endif
#if HAS_Z3_MIN #if HAS_Z3_MIN
#if !AVAILABLE_EILINE(Z3_MIN_PIN) #if !AVAILABLE_EILINE(Z3_MIN_PIN)
#error "Z3_MIN_PIN has no EXTINT line available." #error "Z3_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z3_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(Z3_MIN_PIN);
#endif #endif
#if HAS_Z4_MAX #if HAS_Z4_MAX
#if !AVAILABLE_EILINE(Z4_MAX_PIN) #if !AVAILABLE_EILINE(Z4_MAX_PIN)
#error "Z4_MAX_PIN has no EXTINT line available." #error "Z4_MAX_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z4_MAX_PIN, endstop_ISR, CHANGE); _ATTACH(Z4_MAX_PIN);
#endif #endif
#if HAS_Z4_MIN #if HAS_Z4_MIN
#if !AVAILABLE_EILINE(Z4_MIN_PIN) #if !AVAILABLE_EILINE(Z4_MIN_PIN)
#error "Z4_MIN_PIN has no EXTINT line available." #error "Z4_MIN_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z4_MIN_PIN, endstop_ISR, CHANGE); _ATTACH(Z4_MIN_PIN);
#endif #endif
#if HAS_Z_MIN_PROBE_PIN #if HAS_Z_MIN_PROBE_PIN
#if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN) #if !AVAILABLE_EILINE(Z_MIN_PROBE_PIN)
#error "Z_MIN_PROBE_PIN has no EXTINT line available." #error "Z_MIN_PROBE_PIN has no EXTINT line available."
#endif #endif
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE); _ATTACH(Z_MIN_PROBE_PIN);
#endif #endif
} }