Browse Source

Fix some pin inits

Scott Lahteine 4 years ago
parent
commit
b3223d7b41

+ 2
- 4
Marlin/src/lcd/extui/lib/anycubic_i3mega/anycubic_i3mega_lcd.cpp View File

123
 
123
 
124
   // initialise the state of the key pins running on the tft
124
   // initialise the state of the key pins running on the tft
125
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
125
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
126
-    pinMode(SD_DETECT_PIN, INPUT);
127
-    WRITE(SD_DETECT_PIN, HIGH);
126
+    SET_INPUT_PULLUP(SD_DETECT_PIN);
128
   #endif
127
   #endif
129
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
128
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
130
-    pinMode(FIL_RUNOUT_PIN, INPUT);
131
-    WRITE(FIL_RUNOUT_PIN, HIGH);
129
+    SET_INPUT_PULLUP(FIL_RUNOUT_PIN);
132
   #endif
130
   #endif
133
 
131
 
134
   mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;
132
   mediaPrintingState = AMPRINTSTATE_NOT_PRINTING;

+ 3
- 3
Marlin/src/lcd/extui/lib/mks_ui/printer_operation.cpp View File

161
 
161
 
162
 void filament_pin_setup() {
162
 void filament_pin_setup() {
163
   #if PIN_EXISTS(MT_DET_1)
163
   #if PIN_EXISTS(MT_DET_1)
164
-    pinMode(MT_DET_1_PIN, INPUT_PULLUP);
164
+    SET_INPUT_PULLUP(MT_DET_1_PIN);
165
   #endif
165
   #endif
166
   #if PIN_EXISTS(MT_DET_2)
166
   #if PIN_EXISTS(MT_DET_2)
167
-    pinMode(MT_DET_2_PIN, INPUT_PULLUP);
167
+    SET_INPUT_PULLUP(MT_DET_2_PIN);
168
   #endif
168
   #endif
169
   #if PIN_EXISTS(MT_DET_3)
169
   #if PIN_EXISTS(MT_DET_3)
170
-    pinMode(MT_DET_3_PIN, INPUT_PULLUP);
170
+    SET_INPUT_PULLUP(MT_DET_3_PIN);
171
   #endif
171
   #endif
172
 }
172
 }
173
 
173
 

Loading…
Cancel
Save