Browse Source

Merge pull request #7871 from thinkyhead/bf1_fix_sd_listing_bug

[1.1.x] Fix sd file list display bug
Scott Lahteine 7 years ago
parent
commit
b825bc87ae
2 changed files with 10 additions and 21 deletions
  1. 7
    19
      Marlin/Conditionals_LCD.h
  2. 3
    2
      Marlin/ultralcd_impl_DOGM.h

+ 7
- 19
Marlin/Conditionals_LCD.h View File

@@ -34,7 +34,6 @@
34 34
 
35 35
     #define DOGLCD
36 36
     #define ULTIPANEL
37
-    #define NEWPANEL
38 37
     #define DEFAULT_LCD_CONTRAST 90
39 38
     #define LCD_CONTRAST_MIN 60
40 39
     #define LCD_CONTRAST_MAX 140
@@ -43,7 +42,6 @@
43 42
 
44 43
     #define DOGLCD
45 44
     #define ULTIPANEL
46
-    #define NEWPANEL
47 45
     #define DEFAULT_LCD_CONTRAST 17
48 46
 
49 47
   #elif ENABLED(ANET_KEYPAD_LCD)
@@ -90,7 +88,6 @@
90 88
 
91 89
     #define U8GLIB_SSD1306
92 90
     #define ULTIPANEL
93
-    #define NEWPANEL
94 91
     #define REVERSE_ENCODER_DIRECTION
95 92
     #define REVERSE_MENU_DIRECTION
96 93
 
@@ -99,14 +96,12 @@
99 96
     #define LCD_I2C_TYPE_PCA8574
100 97
     #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
101 98
     #define ULTIPANEL
102
-    #define NEWPANEL
103 99
 
104 100
   #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
105 101
 
106 102
     #define DOGLCD
107 103
     #define U8GLIB_ST7920
108 104
     #define ULTIPANEL
109
-    #define NEWPANEL
110 105
 
111 106
   #endif
112 107
 
@@ -131,7 +126,6 @@
131 126
    || ENABLED(G3D_PANEL)                        \
132 127
    || ENABLED(RIGIDBOT_PANEL)
133 128
     #define ULTIPANEL
134
-    #define NEWPANEL
135 129
   #endif
136 130
 
137 131
   #if ENABLED(REPRAPWORLD_KEYPAD)
@@ -153,7 +147,6 @@
153 147
     #define LCD_I2C_TYPE_PCF8575
154 148
     #define LCD_I2C_ADDRESS 0x27   // I2C Address of the port expander
155 149
     #define ULTIPANEL
156
-    #define NEWPANEL
157 150
 
158 151
   #elif ENABLED(LCD_I2C_PANELOLU2)
159 152
 
@@ -163,7 +156,6 @@
163 156
     #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
164 157
     #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
165 158
     #define ULTIPANEL
166
-    #define NEWPANEL
167 159
 
168 160
   #elif ENABLED(LCD_I2C_VIKI)
169 161
 
@@ -179,7 +171,6 @@
179 171
     #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
180 172
     #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
181 173
     #define ULTIPANEL
182
-    #define NEWPANEL
183 174
 
184 175
     #define ENCODER_FEEDRATE_DEADZONE 4
185 176
 
@@ -222,7 +213,6 @@
222 213
   #if ENABLED(SAV_3DLCD)
223 214
     #define SR_LCD_2W_NL    // Non latching 2 wire shift register
224 215
     #define ULTIPANEL
225
-    #define NEWPANEL
226 216
   #endif
227 217
 
228 218
   #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
@@ -235,7 +225,7 @@
235 225
   #endif
236 226
 
237 227
   #if ENABLED(ULTIPANEL)
238
-    #define NEWPANEL  //enable this if you have a click-encoder panel
228
+    #define NEWPANEL  // Disable this if you actually have no click-encoder panel
239 229
     #define ULTRA_LCD
240 230
     #ifndef LCD_WIDTH
241 231
       #define LCD_WIDTH 20
@@ -243,14 +233,12 @@
243 233
     #ifndef LCD_HEIGHT
244 234
       #define LCD_HEIGHT 4
245 235
     #endif
246
-  #else // no panel but just LCD
247
-    #if ENABLED(ULTRA_LCD)
248
-      #ifndef LCD_WIDTH
249
-        #define LCD_WIDTH 16
250
-      #endif
251
-      #ifndef LCD_HEIGHT
252
-        #define LCD_HEIGHT 2
253
-      #endif
236
+  #elif ENABLED(ULTRA_LCD)  // no panel but just LCD
237
+    #ifndef LCD_WIDTH
238
+      #define LCD_WIDTH 16
239
+    #endif
240
+    #ifndef LCD_HEIGHT
241
+      #define LCD_HEIGHT 2
254 242
     #endif
255 243
   #endif
256 244
 

+ 3
- 2
Marlin/ultralcd_impl_DOGM.h View File

@@ -918,14 +918,15 @@ static void lcd_implementation_status_screen() {
918 918
       if (!PAGE_CONTAINS(row_y1, row_y2)) return;
919 919
 
920 920
       uint8_t n = LCD_WIDTH - (START_COL) - 1;
921
+      char c;
921 922
       if (longFilename[0]) {
922 923
         filename = longFilename;
923
-        longFilename[n] = '\0';
924
+        longFilename[n] = '\0'; // cutoff at screen edge
924 925
       }
925 926
 
926 927
       if (isDir) lcd_print(LCD_STR_FOLDER[0]);
927 928
 
928
-      while (char c = *filename) {
929
+      while ((c = *filename) && n > 0) {
929 930
         n -= lcd_print_and_count(c);
930 931
         filename++;
931 932
       }

Loading…
Cancel
Save