Merge pull request #7872 from thinkyhead/bf2_fix_sd_listing_bug

[2.0.x] Fix sd file list display bug
This commit is contained in:
Scott Lahteine 2017-10-07 00:13:20 -05:00 committed by GitHub
commit db8ded90c2
2 changed files with 4 additions and 14 deletions

View file

@ -34,7 +34,6 @@
#define DOGLCD #define DOGLCD
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#define DEFAULT_LCD_CONTRAST 90 #define DEFAULT_LCD_CONTRAST 90
#define LCD_CONTRAST_MIN 60 #define LCD_CONTRAST_MIN 60
#define LCD_CONTRAST_MAX 140 #define LCD_CONTRAST_MAX 140
@ -43,7 +42,6 @@
#define DOGLCD #define DOGLCD
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#define U8GLIB_ST7565_64128N #define U8GLIB_ST7565_64128N
@ -51,7 +49,6 @@
#define DOGLCD #define DOGLCD
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#define DEFAULT_LCD_CONTRAST 17 #define DEFAULT_LCD_CONTRAST 17
#elif ENABLED(ANET_KEYPAD_LCD) #elif ENABLED(ANET_KEYPAD_LCD)
@ -102,7 +99,6 @@
#define U8GLIB_SSD1306 #define U8GLIB_SSD1306
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#define REVERSE_ENCODER_DIRECTION #define REVERSE_ENCODER_DIRECTION
#define REVERSE_MENU_DIRECTION #define REVERSE_MENU_DIRECTION
@ -111,14 +107,12 @@
#define LCD_I2C_TYPE_PCA8574 #define LCD_I2C_TYPE_PCA8574
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define DOGLCD #define DOGLCD
#define U8GLIB_ST7920 #define U8GLIB_ST7920
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#endif #endif
@ -143,7 +137,6 @@
|| ENABLED(G3D_PANEL) \ || ENABLED(G3D_PANEL) \
|| ENABLED(RIGIDBOT_PANEL) || ENABLED(RIGIDBOT_PANEL)
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#endif #endif
#if ENABLED(REPRAPWORLD_KEYPAD) #if ENABLED(REPRAPWORLD_KEYPAD)
@ -165,7 +158,6 @@
#define LCD_I2C_TYPE_PCF8575 #define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#elif ENABLED(LCD_I2C_PANELOLU2) #elif ENABLED(LCD_I2C_PANELOLU2)
@ -175,7 +167,6 @@
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#elif ENABLED(LCD_I2C_VIKI) #elif ENABLED(LCD_I2C_VIKI)
@ -191,7 +182,6 @@
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later) #define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD (requires LiquidTWI2 v1.2.3 or later)
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#define ENCODER_FEEDRATE_DEADZONE 4 #define ENCODER_FEEDRATE_DEADZONE 4
@ -237,7 +227,6 @@
#if ENABLED(SAV_3DLCD) #if ENABLED(SAV_3DLCD)
#define SR_LCD_2W_NL // Non latching 2 wire shift register #define SR_LCD_2W_NL // Non latching 2 wire shift register
#define ULTIPANEL #define ULTIPANEL
#define NEWPANEL
#endif #endif
#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display #if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
@ -250,7 +239,7 @@
#endif #endif
#if ENABLED(ULTIPANEL) #if ENABLED(ULTIPANEL)
#define NEWPANEL //enable this if you have a click-encoder panel #define NEWPANEL // Disable this if you actually have no click-encoder panel
#define ULTRA_LCD #define ULTRA_LCD
#ifndef LCD_WIDTH #ifndef LCD_WIDTH
#define LCD_WIDTH 20 #define LCD_WIDTH 20

View file

@ -928,14 +928,15 @@ static void lcd_implementation_status_screen() {
if (!PAGE_CONTAINS(row_y1, row_y2)) return; if (!PAGE_CONTAINS(row_y1, row_y2)) return;
uint8_t n = LCD_WIDTH - (START_COL) - 1; uint8_t n = LCD_WIDTH - (START_COL) - 1;
char c;
if (longFilename[0]) { if (longFilename[0]) {
filename = longFilename; filename = longFilename;
longFilename[n] = '\0'; longFilename[n] = '\0'; // cutoff at screen edge
} }
if (isDir) lcd_print(LCD_STR_FOLDER[0]); if (isDir) lcd_print(LCD_STR_FOLDER[0]);
while (char c = *filename) { while ((c = *filename) && n > 0) {
n -= lcd_print_and_count(c); n -= lcd_print_and_count(c);
filename++; filename++;
} }