No need to set input after attachInterrupt

This commit is contained in:
Scott Lahteine 2018-06-12 18:43:05 -05:00
parent e0276d2f32
commit cf53e502a2
3 changed files with 0 additions and 27 deletions

View file

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

View file

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

View file

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