Merge pull request #7871 from thinkyhead/bf1_fix_sd_listing_bug

[1.1.x] Fix sd file list display bug
This commit is contained in:
Scott Lahteine 2017-10-07 00:01:59 -05:00 committed by GitHub
commit b825bc87ae
2 changed files with 10 additions and 21 deletions

View File

@ -34,7 +34,6 @@
#define DOGLCD
#define ULTIPANEL
#define NEWPANEL
#define DEFAULT_LCD_CONTRAST 90
#define LCD_CONTRAST_MIN 60
#define LCD_CONTRAST_MAX 140
@ -43,7 +42,6 @@
#define DOGLCD
#define ULTIPANEL
#define NEWPANEL
#define DEFAULT_LCD_CONTRAST 17
#elif ENABLED(ANET_KEYPAD_LCD)
@ -90,7 +88,6 @@
#define U8GLIB_SSD1306
#define ULTIPANEL
#define NEWPANEL
#define REVERSE_ENCODER_DIRECTION
#define REVERSE_MENU_DIRECTION
@ -99,14 +96,12 @@
#define LCD_I2C_TYPE_PCA8574
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define ULTIPANEL
#define NEWPANEL
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
#define DOGLCD
#define U8GLIB_ST7920
#define ULTIPANEL
#define NEWPANEL
#endif
@ -131,7 +126,6 @@
|| ENABLED(G3D_PANEL) \
|| ENABLED(RIGIDBOT_PANEL)
#define ULTIPANEL
#define NEWPANEL
#endif
#if ENABLED(REPRAPWORLD_KEYPAD)
@ -153,7 +147,6 @@
#define LCD_I2C_TYPE_PCF8575
#define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander
#define ULTIPANEL
#define NEWPANEL
#elif ENABLED(LCD_I2C_PANELOLU2)
@ -163,7 +156,6 @@
#define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander
#define LCD_USE_I2C_BUZZER //comment out to disable buzzer on LCD
#define ULTIPANEL
#define NEWPANEL
#elif ENABLED(LCD_I2C_VIKI)
@ -179,7 +171,6 @@
#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 ULTIPANEL
#define NEWPANEL
#define ENCODER_FEEDRATE_DEADZONE 4
@ -222,7 +213,6 @@
#if ENABLED(SAV_3DLCD)
#define SR_LCD_2W_NL // Non latching 2 wire shift register
#define ULTIPANEL
#define NEWPANEL
#endif
#if ENABLED(DOGLCD) // Change number of lines to match the DOG graphic display
@ -235,7 +225,7 @@
#endif
#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
#ifndef LCD_WIDTH
#define LCD_WIDTH 20
@ -243,14 +233,12 @@
#ifndef LCD_HEIGHT
#define LCD_HEIGHT 4
#endif
#else // no panel but just LCD
#if ENABLED(ULTRA_LCD)
#ifndef LCD_WIDTH
#define LCD_WIDTH 16
#endif
#ifndef LCD_HEIGHT
#define LCD_HEIGHT 2
#endif
#elif ENABLED(ULTRA_LCD) // no panel but just LCD
#ifndef LCD_WIDTH
#define LCD_WIDTH 16
#endif
#ifndef LCD_HEIGHT
#define LCD_HEIGHT 2
#endif
#endif

View File

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