Browse Source

No need to set input after attachInterrupt

pull/1/head
Scott Lahteine 6 years ago
parent
commit
cf53e502a2
  1. 9
      Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h
  2. 9
      Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h
  3. 9
      Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h

9
Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h

@ -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
}

9
Marlin/src/HAL/HAL_STM32F4/endstop_interrupts.h

@ -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
}

9
Marlin/src/HAL/HAL_STM32F7/endstop_interrupts.h

@ -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