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

+ 3
- 2
Marlin/ultralcd_impl_DOGM.h View File

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

Loading…
Cancel
Save