Browse Source

Use fastio for STM32F1 endstop interrupts

Scott Lahteine 7 years ago
parent
commit
c8dfa26bc8
1 changed files with 9 additions and 9 deletions
  1. 9
    9
      Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h

+ 9
- 9
Marlin/src/HAL/HAL_STM32F1/endstop_interrupts.h View File

51
 
51
 
52
 void setup_endstop_interrupts(void) {
52
 void setup_endstop_interrupts(void) {
53
   #if HAS_X_MAX
53
   #if HAS_X_MAX
54
-    pinMode(X_MAX_PIN, INPUT);
54
+    SET_INPUT(X_MAX_PIN);
55
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
55
     attachInterrupt(X_MAX_PIN, endstop_ISR, CHANGE); // assign it
56
   #endif
56
   #endif
57
   #if HAS_X_MIN
57
   #if HAS_X_MIN
58
-    pinMode(X_MIN_PIN, INPUT);
58
+    SET_INPUT(X_MIN_PIN);
59
     attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
59
     attachInterrupt(X_MIN_PIN, endstop_ISR, CHANGE);
60
   #endif
60
   #endif
61
   #if HAS_Y_MAX
61
   #if HAS_Y_MAX
62
-    pinMode(Y_MAX_PIN, INPUT);
62
+    SET_INPUT(Y_MAX_PIN);
63
     attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
63
     attachInterrupt(Y_MAX_PIN, endstop_ISR, CHANGE);
64
   #endif
64
   #endif
65
   #if HAS_Y_MIN
65
   #if HAS_Y_MIN
66
-    pinMode(Y_MIN_PIN, INPUT);
66
+    SET_INPUT(Y_MIN_PIN);
67
     attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
67
     attachInterrupt(Y_MIN_PIN, endstop_ISR, CHANGE);
68
   #endif
68
   #endif
69
   #if HAS_Z_MAX
69
   #if HAS_Z_MAX
70
-    pinMode(Z_MAX_PIN, INPUT);
70
+    SET_INPUT(Z_MAX_PIN);
71
     attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
71
     attachInterrupt(Z_MAX_PIN, endstop_ISR, CHANGE);
72
   #endif
72
   #endif
73
   #if HAS_Z_MIN
73
   #if HAS_Z_MIN
74
-    pinMode(Z_MIN_PIN, INPUT);
74
+    SET_INPUT(Z_MIN_PIN);
75
     attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
75
     attachInterrupt(Z_MIN_PIN, endstop_ISR, CHANGE);
76
   #endif
76
   #endif
77
   #if HAS_Z2_MAX
77
   #if HAS_Z2_MAX
78
-    pinMode(Z2_MAX_PIN, INPUT);
78
+    SET_INPUT(Z2_MAX_PIN);
79
     attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
79
     attachInterrupt(Z2_MAX_PIN, endstop_ISR, CHANGE);
80
   #endif
80
   #endif
81
   #if HAS_Z2_MIN
81
   #if HAS_Z2_MIN
82
-    pinMode(Z2_MIN_PIN, INPUT);
82
+    SET_INPUT(Z2_MIN_PIN);
83
     attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
83
     attachInterrupt(Z2_MIN_PIN, endstop_ISR, CHANGE);
84
   #endif
84
   #endif
85
   #if HAS_Z_MIN_PROBE_PIN
85
   #if HAS_Z_MIN_PROBE_PIN
86
-    pinMode(Z_MIN_PROBE_PIN, INPUT);
86
+    SET_INPUT(Z_MIN_PROBE_PIN);
87
     attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
87
     attachInterrupt(Z_MIN_PROBE_PIN, endstop_ISR, CHANGE);
88
   #endif
88
   #endif
89
 }
89
 }

Loading…
Cancel
Save