Browse Source

Rename SDCARDDETECT to SDCARDDETECT_PIN

- Rename the pin so it can be tested with `PIN_EXISTS`
- Fix some incorrect tests for `SDCARDDETECT`
Scott Lahteine 8 years ago
parent
commit
8d3b74cc6e

+ 3
- 3
Marlin/cardreader.h View File

81
 
81
 
82
 #define IS_SD_PRINTING (card.sdprinting)
82
 #define IS_SD_PRINTING (card.sdprinting)
83
 
83
 
84
-#if (SDCARDDETECT > -1)
84
+#if PIN_EXISTS(SDCARDDETECT)
85
   #if ENABLED(SDCARDDETECTINVERTED)
85
   #if ENABLED(SDCARDDETECTINVERTED)
86
-    #define IS_SD_INSERTED (READ(SDCARDDETECT) != 0)
86
+    #define IS_SD_INSERTED (READ(SDCARDDETECT_PIN) != 0)
87
   #else
87
   #else
88
-    #define IS_SD_INSERTED (READ(SDCARDDETECT) == 0)
88
+    #define IS_SD_INSERTED (READ(SDCARDDETECT_PIN) == 0)
89
   #endif
89
   #endif
90
 #else
90
 #else
91
   //No card detect line? Assume the card is inserted.
91
   //No card detect line? Assume the card is inserted.

+ 1
- 1
Marlin/pins_AZTEEG_X3_PRO.h View File

109
   #define BTN_ENC          39  //the click switch
109
   #define BTN_ENC          39  //the click switch
110
  
110
  
111
   #define SDSS             53
111
   #define SDSS             53
112
-  #define SDCARDDETECT     49
112
+  #define SDCARDDETECT_PIN 49
113
   
113
   
114
   #define KILL_PIN         31
114
   #define KILL_PIN         31
115
  #endif
115
  #endif

+ 1
- 1
Marlin/pins_BRAINWAVE_PRO.h View File

54
 #define PS_ON_PIN          -1
54
 #define PS_ON_PIN          -1
55
 #define KILL_PIN           -1
55
 #define KILL_PIN           -1
56
 #define ALARM_PIN          -1
56
 #define ALARM_PIN          -1
57
-#define SDCARDDETECT       12
57
+#define SDCARDDETECT_PIN   12
58
 
58
 
59
 #if DISABLED(SDSUPPORT)
59
 #if DISABLED(SDSUPPORT)
60
 // these pins are defined in the SD library if building with SD support
60
 // these pins are defined in the SD library if building with SD support

+ 1
- 1
Marlin/pins_CHEAPTRONIC.h View File

86
 #define BLEN_A 0
86
 #define BLEN_A 0
87
 
87
 
88
 // Cheaptronic v1.0 does not use this port
88
 // Cheaptronic v1.0 does not use this port
89
-#define SDCARDDETECT -1
89
+#define SDCARDDETECT_PIN -1

+ 1
- 1
Marlin/pins_ELEFU_3.h View File

64
 #if ENABLED(RA_CONTROL_PANEL)
64
 #if ENABLED(RA_CONTROL_PANEL)
65
 
65
 
66
   #define SDSS             53
66
   #define SDSS             53
67
-  #define SDCARDDETECT     28
67
+  #define SDCARDDETECT_PIN 28
68
 
68
 
69
   #define BTN_EN1          14
69
   #define BTN_EN1          14
70
   #define BTN_EN2          39
70
   #define BTN_EN2          39

+ 1
- 1
Marlin/pins_FELIX2.h View File

19
   #define BLEN_C 2
19
   #define BLEN_C 2
20
   #define BLEN_B 1
20
   #define BLEN_B 1
21
   #define BLEN_A 0
21
   #define BLEN_A 0
22
-  #define SDCARDDETECT 6
22
+  #define SDCARDDETECT_PIN 6
23
 
23
 
24
 #endif // NEWPANEL && ULTRA_LCD
24
 #endif // NEWPANEL && ULTRA_LCD

+ 1
- 1
Marlin/pins_GEN7_CUSTOM.h View File

57
 //#define RX_ENABLE_PIN       13
57
 //#define RX_ENABLE_PIN       13
58
 
58
 
59
 #define BEEPER_PIN -1
59
 #define BEEPER_PIN -1
60
-#define SDCARDDETECT -1
60
+#define SDCARDDETECT_PIN -1
61
 #define SUICIDE_PIN -1    //has to be defined; otherwise Power_off doesn't work
61
 #define SUICIDE_PIN -1    //has to be defined; otherwise Power_off doesn't work
62
 
62
 
63
 #define KILL_PIN -1
63
 #define KILL_PIN -1

+ 1
- 1
Marlin/pins_LEAPFROG.h View File

42
 
42
 
43
 #define SDPOWER            -1
43
 #define SDPOWER            -1
44
 #define SDSS               11
44
 #define SDSS               11
45
-#define SDCARDDETECT       -1 // 10 optional also used as mode pin
45
+#define SDCARDDETECT_PIN   -1 // 10 optional also used as mode pin
46
 #define LED_PIN            13
46
 #define LED_PIN            13
47
 #define FAN_PIN            7
47
 #define FAN_PIN            7
48
 #define PS_ON_PIN          -1
48
 #define PS_ON_PIN          -1

+ 1
- 1
Marlin/pins_MEGACONTROLLER.h View File

107
     #define BTN_EN2 11
107
     #define BTN_EN2 11
108
     #define BTN_ENC 10  //the click switch
108
     #define BTN_ENC 10  //the click switch
109
     //not connected to a pin
109
     //not connected to a pin
110
-    #define SDCARDDETECT 49
110
+    #define SDCARDDETECT_PIN 49
111
 #endif //Minipanel
111
 #endif //Minipanel
112
 
112
 

+ 1
- 1
Marlin/pins_MEGATRONICS.h View File

78
   #define BLEN_B           1
78
   #define BLEN_B           1
79
   #define BLEN_A           0
79
   #define BLEN_A           0
80
 
80
 
81
-  #define SDCARDDETECT    -1   // RAMPS doesn't use this
81
+  #define SDCARDDETECT_PIN -1   // RAMPS doesn't use this
82
 
82
 
83
 #endif // ULTRA_LCD && NEWPANEL
83
 #endif // ULTRA_LCD && NEWPANEL

+ 1
- 1
Marlin/pins_MEGATRONICS_2.h View File

94
 #define BLEN_B 1
94
 #define BLEN_B 1
95
 #define BLEN_A 0
95
 #define BLEN_A 0
96
 
96
 
97
-#define SDCARDDETECT -1  // Megatronics does not use this port
97
+#define SDCARDDETECT_PIN -1  // Megatronics does not use this port

+ 1
- 1
Marlin/pins_MEGATRONICS_3.h View File

99
 #define BLEN_B 1
99
 #define BLEN_B 1
100
 #define BLEN_A 0
100
 #define BLEN_A 0
101
 
101
 
102
-#define SDCARDDETECT -1	// Megatronics does not use this port
102
+#define SDCARDDETECT_PIN -1	// Megatronics does not use this port

+ 1
- 1
Marlin/pins_MINIRAMBO.h View File

107
     #define BTN_EN2         72
107
     #define BTN_EN2         72
108
     #define BTN_ENC          9  // the click
108
     #define BTN_ENC          9  // the click
109
 
109
 
110
-    #define SDCARDDETECT    15
110
+    #define SDCARDDETECT_PIN 15
111
 
111
 
112
   #endif //NEWPANEL
112
   #endif //NEWPANEL
113
 #endif //ULTRA_LCD
113
 #endif //ULTRA_LCD

+ 1
- 1
Marlin/pins_MINITRONICS.h View File

78
 #define BLEN_B 1
78
 #define BLEN_B 1
79
 #define BLEN_A 0
79
 #define BLEN_A 0
80
 
80
 
81
-#define SDCARDDETECT -1  // Megatronics does not use this port
81
+#define SDCARDDETECT_PIN -1  // Minitronics does not use this port

+ 1
- 1
Marlin/pins_OMCA.h View File

70
 
70
 
71
 #define SDPOWER            -1
71
 #define SDPOWER            -1
72
 #define SDSS               11
72
 #define SDSS               11
73
-#define SDCARDDETECT       -1 // 10 optional also used as mode pin
73
+#define SDCARDDETECT_PIN   -1 // 10 optional also used as mode pin
74
 #define LED_PIN            -1
74
 #define LED_PIN            -1
75
 #define FAN_PIN            14 // PWM on MIDDLE connector
75
 #define FAN_PIN            14 // PWM on MIDDLE connector
76
 #define PS_ON_PIN          -1
76
 #define PS_ON_PIN          -1

+ 1
- 1
Marlin/pins_OMCA_A.h View File

61
 
61
 
62
 #define SDPOWER            -1
62
 #define SDPOWER            -1
63
 #define SDSS               11
63
 #define SDSS               11
64
-#define SDCARDDETECT       -1 // 10 optional also used as mode pin
64
+#define SDCARDDETECT_PIN   -1 // 10 optional also used as mode pin
65
 #define LED_PIN            -1
65
 #define LED_PIN            -1
66
 #define FAN_PIN            3
66
 #define FAN_PIN            3
67
 #define PS_ON_PIN          -1
67
 #define PS_ON_PIN          -1

+ 2
- 2
Marlin/pins_PRINTRBOARD.h View File

88
     #define SDSS   40 //use SD card on Panelolu2 (Teensyduino pin mapping)
88
     #define SDSS   40 //use SD card on Panelolu2 (Teensyduino pin mapping)
89
   #endif // LCD_I2C_PANELOLU2
89
   #endif // LCD_I2C_PANELOLU2
90
   //not connected to a pin
90
   //not connected to a pin
91
-  #define SDCARDDETECT -1    
91
+  #define SDCARDDETECT_PIN -1    
92
 #endif // ULTRA_LCD && NEWPANEL
92
 #endif // ULTRA_LCD && NEWPANEL
93
 
93
 
94
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
94
 #if ENABLED(VIKI2) || ENABLED(miniVIKI)
104
  #define BTN_ENC 47  //the click switch
104
  #define BTN_ENC 47  //the click switch
105
 
105
 
106
  #define SDSS 45
106
  #define SDSS 45
107
- #define SDCARDDETECT -1 // FastIO (Manual says 72 I'm not certain cause I can't test) 
107
+ #define SDCARDDETECT_PIN -1 // FastIO (Manual says 72 I'm not certain cause I can't test) 
108
 
108
 
109
  #if ENABLED(TEMP_STAT_LEDS)
109
  #if ENABLED(TEMP_STAT_LEDS)
110
   #define STAT_LED_RED      12 //Non-FastIO
110
   #define STAT_LED_RED      12 //Non-FastIO

+ 2
- 2
Marlin/pins_RAMBO.h View File

133
     #define BLEN_B 1
133
     #define BLEN_B 1
134
     #define BLEN_A 0
134
     #define BLEN_A 0
135
 
135
 
136
-    #define SDCARDDETECT 81    // Ramps does not use this port
136
+    #define SDCARDDETECT_PIN 81 // Ramps doesn't use this port
137
 
137
 
138
   #else //!NEWPANEL - old style panel with shift register
138
   #else //!NEWPANEL - old style panel with shift register
139
 
139
 
180
  #define BTN_EN2 84
180
  #define BTN_EN2 84
181
  #define BTN_ENC 83  //the click switch
181
  #define BTN_ENC 83  //the click switch
182
 
182
 
183
- #define SDCARDDETECT -1 // Pin 72 if using easy adapter board   
183
+ #define SDCARDDETECT_PIN -1 // Pin 72 if using easy adapter board   
184
 
184
 
185
   #if ENABLED(TEMP_STAT_LEDS)
185
   #if ENABLED(TEMP_STAT_LEDS)
186
    #define STAT_LED_RED      22
186
    #define STAT_LED_RED      22

+ 7
- 7
Marlin/pins_RAMPS_13.h View File

165
       #define BTN_EN2 33
165
       #define BTN_EN2 33
166
       #define BTN_ENC 35
166
       #define BTN_ENC 35
167
 
167
 
168
-      #define SDCARDDETECT 49
168
+      #define SDCARDDETECT_PIN 49
169
     #elif ENABLED(LCD_I2C_PANELOLU2)
169
     #elif ENABLED(LCD_I2C_PANELOLU2)
170
       #define BTN_EN1 47  // reverse if the encoder turns the wrong way.
170
       #define BTN_EN1 47  // reverse if the encoder turns the wrong way.
171
       #define BTN_EN2 43
171
       #define BTN_EN2 43
172
       #define BTN_ENC 32
172
       #define BTN_ENC 32
173
       #define LCD_SDSS 53
173
       #define LCD_SDSS 53
174
-      #define SDCARDDETECT -1
174
+      #define SDCARDDETECT_PIN -1
175
       #define KILL_PIN 41
175
       #define KILL_PIN 41
176
     #elif ENABLED(LCD_I2C_VIKI)
176
     #elif ENABLED(LCD_I2C_VIKI)
177
       #define BTN_EN1 22  // reverse if the encoder turns the wrong way.
177
       #define BTN_EN1 22  // reverse if the encoder turns the wrong way.
178
       #define BTN_EN2 7
178
       #define BTN_EN2 7
179
       #define BTN_ENC -1
179
       #define BTN_ENC -1
180
       #define LCD_SDSS 53
180
       #define LCD_SDSS 53
181
-      #define SDCARDDETECT 49
181
+      #define SDCARDDETECT_PIN 49
182
     #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
182
     #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
183
       #define BTN_EN1 35  // reverse if the encoder turns the wrong way.
183
       #define BTN_EN1 35  // reverse if the encoder turns the wrong way.
184
       #define BTN_EN2 37
184
       #define BTN_EN2 37
185
       #define BTN_ENC 31
185
       #define BTN_ENC 31
186
-      #define SDCARDDETECT 49
186
+      #define SDCARDDETECT_PIN 49
187
       #define LCD_SDSS 53
187
       #define LCD_SDSS 53
188
       #define KILL_PIN 41
188
       #define KILL_PIN 41
189
       #define BEEPER_PIN 23
189
       #define BEEPER_PIN 23
210
        #define BTN_EN2 63
210
        #define BTN_EN2 63
211
        #define BTN_ENC 59  //the click switch
211
        #define BTN_ENC 59  //the click switch
212
        //not connected to a pin
212
        //not connected to a pin
213
-       #define SDCARDDETECT 49
213
+       #define SDCARDDETECT_PIN 49
214
 
214
 
215
     #else
215
     #else
216
 
216
 
235
       #endif
235
       #endif
236
 
236
 
237
       #if ENABLED(G3D_PANEL)
237
       #if ENABLED(G3D_PANEL)
238
-        #define SDCARDDETECT 49
238
+        #define SDCARDDETECT_PIN 49
239
       #else
239
       #else
240
-        #define SDCARDDETECT -1  // Ramps does not use this port
240
+        #define SDCARDDETECT_PIN -1  // Ramps does not use this port
241
       #endif
241
       #endif
242
 
242
 
243
     #endif
243
     #endif

+ 6
- 6
Marlin/pins_RIGIDBOARD.h View File

25
   #undef BEEPER_PIN
25
   #undef BEEPER_PIN
26
   #define BEEPER_PIN -1
26
   #define BEEPER_PIN -1
27
 
27
 
28
-  #undef SDCARDDETECT
29
-  #define SDCARDDETECT 22
28
+  #undef SDCARDDETECT_PIN
29
+  #define SDCARDDETECT_PIN 22
30
 
30
 
31
   // Extra button definitions, substitute for EN1 / EN2
31
   // Extra button definitions, substitute for EN1 / EN2
32
   #define BTN_UP  37 // BTN_EN1
32
   #define BTN_UP  37 // BTN_EN1
43
   #undef  BTN_ENC
43
   #undef  BTN_ENC
44
   #define BTN_ENC 31
44
   #define BTN_ENC 31
45
 
45
 
46
-  #undef  SDCARDDETECT
47
-  #define SDCARDDETECT 22
46
+  #undef  SDCARDDETECT_PIN
47
+  #define SDCARDDETECT_PIN 22
48
 
48
 
49
 #elif defined(REPRAP_DISCOUNT_SMART_CONTROLLER)
49
 #elif defined(REPRAP_DISCOUNT_SMART_CONTROLLER)
50
 
50
 
51
   #undef BEEPER_PIN
51
   #undef BEEPER_PIN
52
   #define BEEPER_PIN -1
52
   #define BEEPER_PIN -1
53
 
53
 
54
-  #undef  SDCARDDETECT
55
-  #define SDCARDDETECT 22
54
+  #undef  SDCARDDETECT_PIN
55
+  #define SDCARDDETECT_PIN 22
56
 
56
 
57
   #undef  KILL_PIN
57
   #undef  KILL_PIN
58
   #define KILL_PIN 32
58
   #define KILL_PIN 32

+ 1
- 1
Marlin/pins_RUMBA.h View File

101
 
101
 
102
 #define SDPOWER            -1
102
 #define SDPOWER            -1
103
 #define SDSS               53
103
 #define SDSS               53
104
-#define SDCARDDETECT       49
104
+#define SDCARDDETECT_PIN   49
105
 #define BEEPER_PIN         44
105
 #define BEEPER_PIN         44
106
 #define LCD_PINS_RS        19
106
 #define LCD_PINS_RS        19
107
 #define LCD_PINS_ENABLE    42
107
 #define LCD_PINS_ENABLE    42

+ 2
- 2
Marlin/pins_SANGUINOLOLU_11.h View File

156
     #define LCD_SDSS            28 // Smart Controller SD card reader rather than the Melzi
156
     #define LCD_SDSS            28 // Smart Controller SD card reader rather than the Melzi
157
   #endif //Panelolu2
157
   #endif //Panelolu2
158
 
158
 
159
-  #define SDCARDDETECT          -1
159
+  #define SDCARDDETECT_PIN      -1
160
 
160
 
161
 #elif ENABLED(MAKRPANEL)
161
 #elif ENABLED(MAKRPANEL)
162
 
162
 
178
   #define BTN_EN2               10
178
   #define BTN_EN2               10
179
   #define BTN_ENC               16
179
   #define BTN_ENC               16
180
 
180
 
181
-  #define SDCARDDETECT          -1
181
+  #define SDCARDDETECT_PIN      -1
182
 
182
 
183
 #endif // MAKRPANEL
183
 #endif // MAKRPANEL
184
 
184
 

+ 1
- 1
Marlin/pins_SAV_MKI.h View File

83
 #define LED_PIN            -1
83
 #define LED_PIN            -1
84
 #define PS_ON_PIN          -1
84
 #define PS_ON_PIN          -1
85
 #define ALARM_PIN          -1
85
 #define ALARM_PIN          -1
86
-#define SDCARDDETECT       -1
86
+#define SDCARDDETECT_PIN   -1
87
 
87
 
88
 #define BEEPER_PIN         -1
88
 #define BEEPER_PIN         -1
89
 #define LCD_PINS_RS        -1
89
 #define LCD_PINS_RS        -1

+ 1
- 1
Marlin/pins_TEENSY2.h View File

86
 #define TEMP_2_PIN         -1
86
 #define TEMP_2_PIN         -1
87
 
87
 
88
 #define SDPOWER            -1
88
 #define SDPOWER            -1
89
-#define SDCARDDETECT       -1   
89
+#define SDCARDDETECT_PIN   -1   
90
 #define SDSS               20 // 8
90
 #define SDSS               20 // 8
91
 #define LED_PIN             6
91
 #define LED_PIN             6
92
 #define PS_ON_PIN          27
92
 #define PS_ON_PIN          27

+ 1
- 1
Marlin/pins_TEENSYLU.h View File

78
     #define SDSS           40  //use SD card on Panelolu2 (Teensyduino pin mapping)
78
     #define SDSS           40  //use SD card on Panelolu2 (Teensyduino pin mapping)
79
   #endif // LCD_I2C_PANELOLU2
79
   #endif // LCD_I2C_PANELOLU2
80
 
80
 
81
-  #define SDCARDDETECT     -1
81
+  #define SDCARDDETECT_PIN -1    
82
 
82
 
83
 #endif // ULTRA_LCD && NEWPANEL
83
 #endif // ULTRA_LCD && NEWPANEL
84
 
84
 

+ 1
- 1
Marlin/pins_ULTIMAIN_2.h View File

76
 #define BLEN_B 1
76
 #define BLEN_B 1
77
 #define BLEN_A 0
77
 #define BLEN_A 0
78
 
78
 
79
-#define SDCARDDETECT 39
79
+#define SDCARDDETECT_PIN 39

+ 2
- 2
Marlin/pins_ULTIMAKER.h View File

73
     #define BTN_EN2 42
73
     #define BTN_EN2 42
74
     #define BTN_ENC 19
74
     #define BTN_ENC 19
75
 
75
 
76
-    #define SDCARDDETECT 38
76
+    #define SDCARDDETECT_PIN 38
77
 
77
 
78
   #else //!NEWPANEL - Old style panel with shift register
78
   #else //!NEWPANEL - Old style panel with shift register
79
 
79
 
90
     #define LCD_PINS_D6 20
90
     #define LCD_PINS_D6 20
91
     #define LCD_PINS_D7 19
91
     #define LCD_PINS_D7 19
92
 
92
 
93
-    #define SDCARDDETECT -1
93
+    #define SDCARDDETECT_PIN -1
94
 
94
 
95
   #endif // !NEWPANEL
95
   #endif // !NEWPANEL
96
 
96
 

+ 10
- 10
Marlin/ultralcd.cpp View File

221
   millis_t next_button_update_ms;
221
   millis_t next_button_update_ms;
222
   uint8_t lastEncoderBits;
222
   uint8_t lastEncoderBits;
223
   uint32_t encoderPosition;
223
   uint32_t encoderPosition;
224
-  #if (SDCARDDETECT > 0)
224
+  #if PIN_EXISTS(SDCARDDETECT)
225
     bool lcd_oldcardstatus;
225
     bool lcd_oldcardstatus;
226
   #endif
226
   #endif
227
 
227
 
411
       }
411
       }
412
       else {
412
       else {
413
         MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
413
         MENU_ITEM(submenu, MSG_CARD_MENU, lcd_sdcard_menu);
414
-        #if SDCARDDETECT < 1
414
+        #if !PIN_EXISTS(SDCARDDETECT)
415
           MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21"));  // SD-card changed by user
415
           MENU_ITEM(gcode, MSG_CNG_SDCARD, PSTR("M21"));  // SD-card changed by user
416
         #endif
416
         #endif
417
       }
417
       }
418
     }
418
     }
419
     else {
419
     else {
420
       MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
420
       MENU_ITEM(submenu, MSG_NO_CARD, lcd_sdcard_menu);
421
-      #if SDCARDDETECT < 1
421
+      #if !PIN_EXISTS(SDCARDDETECT)
422
         MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
422
         MENU_ITEM(gcode, MSG_INIT_SDCARD, PSTR("M21")); // Manually initialize the SD-card via user interface
423
       #endif
423
       #endif
424
     }
424
     }
1156
   }
1156
   }
1157
 #endif // FWRETRACT
1157
 #endif // FWRETRACT
1158
 
1158
 
1159
-#if SDCARDDETECT == -1
1159
+#if !PIN_EXISTS(SDCARDDETECT)
1160
   static void lcd_sd_refresh() {
1160
   static void lcd_sd_refresh() {
1161
     card.initsd();
1161
     card.initsd();
1162
     currentMenuViewOffset = 0;
1162
     currentMenuViewOffset = 0;
1180
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
1180
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
1181
   card.getWorkDirName();
1181
   card.getWorkDirName();
1182
   if (card.filename[0] == '/') {
1182
   if (card.filename[0] == '/') {
1183
-    #if SDCARDDETECT == -1
1183
+    #if !PIN_EXISTS(SDCARDDETECT)
1184
       MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
1184
       MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
1185
     #endif
1185
     #endif
1186
   }
1186
   }
1407
   #endif // SR_LCD_2W_NL
1407
   #endif // SR_LCD_2W_NL
1408
 #endif//!NEWPANEL
1408
 #endif//!NEWPANEL
1409
 
1409
 
1410
-  #if ENABLED(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1411
-    pinMode(SDCARDDETECT, INPUT);
1412
-    WRITE(SDCARDDETECT, HIGH);
1410
+  #if ENABLED(SDSUPPORT) && PIN_EXISTS(SDCARDDETECT)
1411
+    pinMode(SDCARDDETECT_PIN, INPUT);
1412
+    WRITE(SDCARDDETECT_PIN, HIGH);
1413
     lcd_oldcardstatus = IS_SD_INSERTED;
1413
     lcd_oldcardstatus = IS_SD_INSERTED;
1414
-  #endif //(SDCARDDETECT > 0)
1414
+  #endif
1415
 
1415
 
1416
   #if ENABLED(LCD_HAS_SLOW_BUTTONS)
1416
   #if ENABLED(LCD_HAS_SLOW_BUTTONS)
1417
     slow_buttons = 0;
1417
     slow_buttons = 0;
1466
 
1466
 
1467
   lcd_buttons_update();
1467
   lcd_buttons_update();
1468
 
1468
 
1469
-  #if (SDCARDDETECT > 0)
1469
+  #if PIN_EXISTS(SDCARDDETECT)
1470
     if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) {
1470
     if (IS_SD_INSERTED != lcd_oldcardstatus && lcd_detected()) {
1471
       lcdDrawUpdate = 2;
1471
       lcdDrawUpdate = 2;
1472
       lcd_oldcardstatus = IS_SD_INSERTED;
1472
       lcd_oldcardstatus = IS_SD_INSERTED;

Loading…
Cancel
Save