No need to set input after attachInterrupt

2.0.x
Scott Lahteine 7 years ago
parent e0276d2f32
commit cf53e502a2

@ -57,39 +57,30 @@ void endstop_ISR(void) { endstops.check_possible_change(); }
void setup_endstop_interrupts(void) {
#if HAS_X_MAX
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
SET_INPUT(X_MAX_PIN);
#endif
#if HAS_X_MIN
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(X_MIN_PIN);
#endif
#if HAS_Y_MAX
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PROBE_PIN);
#endif
}

@ -32,39 +32,30 @@ void endstop_ISR(void) { endstops.check_possible_change(); }
void setup_endstop_interrupts(void) {
#if HAS_X_MAX
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(X_MAX_PIN);
#endif
#if HAS_X_MIN
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(X_MIN_PIN);
#endif
#if HAS_Y_MAX
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PROBE_PIN);
#endif
}

@ -34,39 +34,30 @@ void endstop_ISR(void) { endstops.check_possible_change(); }
void setup_endstop_interrupts(void) {
#if HAS_X_MAX
attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(X_MAX_PIN);
#endif
#if HAS_X_MIN
attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(X_MIN_PIN);
#endif
#if HAS_Y_MAX
attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MAX_PIN);
#endif
#if HAS_Y_MIN
attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Y_MIN_PIN);
#endif
#if HAS_Z_MAX
attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MAX_PIN);
#endif
#if HAS_Z_MIN
attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PIN);
#endif
#if HAS_Z2_MAX
attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MAX_PIN);
#endif
#if HAS_Z2_MIN
attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z2_MIN_PIN);
#endif
#if HAS_Z_MIN_PROBE_PIN
attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
SET_INPUT(Z_MIN_PROBE_PIN);
#endif
}

Loading…
Cancel
Save