Browse Source

Change pinMode to SET_INPUT or SET_OUTPUT

Original code is using WRITE from fastio, but original used pinMode to
set pin direction and did not use the fastio SET_INPUT or SET_OUTPUT.
This caused an issue with the rotary encoder interface to  boards based
on teensyduino, since for teensyduino pin numbers for fastio and the
usual Arduino IO are different.
Filip Mulier 10 years ago
parent
commit
1d0fe035f3
1 changed files with 13 additions and 13 deletions
  1. 13
    13
      Marlin/ultralcd.cpp

+ 13
- 13
Marlin/ultralcd.cpp View File

@@ -1133,30 +1133,30 @@ void lcd_init()
1133 1133
     lcd_implementation_init();
1134 1134
 
1135 1135
 #ifdef NEWPANEL
1136
-    pinMode(BTN_EN1,INPUT);
1137
-    pinMode(BTN_EN2,INPUT);
1136
+    SET_INPUT(BTN_EN1);
1137
+    SET_INPUT(BTN_EN2);
1138 1138
     WRITE(BTN_EN1,HIGH);
1139 1139
     WRITE(BTN_EN2,HIGH);
1140 1140
   #if BTN_ENC > 0
1141
-    pinMode(BTN_ENC,INPUT);
1141
+    SET_INPUT(BTN_ENC);
1142 1142
     WRITE(BTN_ENC,HIGH);
1143 1143
   #endif
1144 1144
   #ifdef REPRAPWORLD_KEYPAD
1145
-    pinMode(SHIFT_CLK,OUTPUT);
1146
-    pinMode(SHIFT_LD,OUTPUT);
1147
-    pinMode(SHIFT_OUT,INPUT);
1145
+    SET_OUTPUT(SHIFT_CLK);
1146
+    SET_OUTPUT(SHIFT_LD);
1147
+    SET_INPUT(SHIFT_OUT);
1148 1148
     WRITE(SHIFT_OUT,HIGH);
1149 1149
     WRITE(SHIFT_LD,HIGH);
1150 1150
   #endif
1151 1151
 #else  // Not NEWPANEL
1152 1152
   #ifdef SR_LCD_2W_NL // Non latching 2 wire shift register
1153
-     pinMode (SR_DATA_PIN, OUTPUT);
1154
-     pinMode (SR_CLK_PIN, OUTPUT);
1153
+     SET_OUTPUT(SR_DATA_PIN);
1154
+     SET_OUTPUT(SR_CLK_PIN);
1155 1155
   #elif defined(SHIFT_CLK) 
1156
-     pinMode(SHIFT_CLK,OUTPUT);
1157
-     pinMode(SHIFT_LD,OUTPUT);
1158
-     pinMode(SHIFT_EN,OUTPUT);
1159
-     pinMode(SHIFT_OUT,INPUT);
1156
+     SET_OUTPUT(SHIFT_CLK);
1157
+     SET_OUTPUT(SHIFT_LD);
1158
+     SET_OUTPUT(SHIFT_EN);
1159
+     SET_INPUT(SHIFT_OUT);
1160 1160
      WRITE(SHIFT_OUT,HIGH);
1161 1161
      WRITE(SHIFT_LD,HIGH);
1162 1162
      WRITE(SHIFT_EN,LOW);
@@ -1168,7 +1168,7 @@ void lcd_init()
1168 1168
 #endif//!NEWPANEL
1169 1169
 
1170 1170
 #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1171
-    pinMode(SDCARDDETECT,INPUT);
1171
+    SET_INPUT(SDCARDDETECT);
1172 1172
     WRITE(SDCARDDETECT, HIGH);
1173 1173
     lcd_oldcardstatus = IS_SD_INSERTED;
1174 1174
 #endif//(SDCARDDETECT > 0)

Loading…
Cancel
Save