瀏覽代碼

Merge pull request #8020 from thinkyhead/bf1_scroll_longnames

[1.1.x] Add SCROLL_LONG_FILENAMES to reveal longer filenames
Scott Lahteine 7 年之前
父節點
當前提交
1d5fb360cc
共有 38 個文件被更改,包括 355 次插入138 次删除
  1. 2
    2
      .travis.yml
  2. 0
    1
      Marlin/Conditionals_LCD.h
  3. 5
    0
      Marlin/Configuration_adv.h
  4. 10
    0
      Marlin/SanityCheck.h
  5. 1
    1
      Marlin/SdBaseFile.cpp
  6. 113
    101
      Marlin/SdFatConfig.h
  7. 1
    1
      Marlin/cardreader.h
  8. 5
    0
      Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h
  9. 6
    1
      Marlin/example_configurations/Anet/A6/Configuration_adv.h
  10. 5
    0
      Marlin/example_configurations/Anet/A8/Configuration_adv.h
  11. 5
    0
      Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h
  12. 5
    0
      Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h
  13. 5
    0
      Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h
  14. 5
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  15. 9
    4
      Marlin/example_configurations/Creality/CR-10/Configuration_adv.h
  16. 5
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  17. 9
    4
      Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h
  18. 5
    0
      Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h
  19. 5
    0
      Marlin/example_configurations/Malyan/M150/Configuration_adv.h
  20. 5
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  21. 5
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  22. 5
    0
      Marlin/example_configurations/Sanguinololu/Configuration_adv.h
  23. 5
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  24. 5
    0
      Marlin/example_configurations/Velleman/K8200/Configuration_adv.h
  25. 5
    0
      Marlin/example_configurations/Velleman/K8400/Configuration_adv.h
  26. 9
    4
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  27. 5
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  28. 5
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  29. 5
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  30. 5
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  31. 5
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  32. 9
    4
      Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h
  33. 5
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  34. 5
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  35. 5
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  36. 18
    3
      Marlin/ultralcd.cpp
  37. 23
    6
      Marlin/ultralcd_impl_DOGM.h
  38. 25
    6
      Marlin/ultralcd_impl_HD44780.h

+ 2
- 2
.travis.yml 查看文件

@@ -252,7 +252,7 @@ script:
252 252
   #
253 253
   - restore_configs
254 254
   - opt_enable G3D_PANEL SDSUPPORT
255
-  - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING
255
+  - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES
256 256
   - opt_set_adv SDSORT_GCODE true
257 257
   - opt_set_adv SDSORT_USES_RAM true
258 258
   - opt_set_adv SDSORT_USES_STACK true
@@ -263,7 +263,7 @@ script:
263 263
   #
264 264
   - restore_configs
265 265
   - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
266
-  - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING
266
+  - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING SCROLL_LONG_FILENAMES
267 267
   - build_marlin
268 268
   #
269 269
   # REPRAPWORLD_KEYPAD

+ 0
- 1
Marlin/Conditionals_LCD.h 查看文件

@@ -62,7 +62,6 @@
62 62
   #elif ENABLED(BQ_LCD_SMART_CONTROLLER)
63 63
 
64 64
     #define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
65
-    #define LONG_FILENAME_HOST_SUPPORT
66 65
 
67 66
   #elif ENABLED(miniVIKI) || ENABLED(VIKI2) || ENABLED(ELB_FULL_GRAPHIC_CONTROLLER)
68 67
 

+ 5
- 0
Marlin/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 10
- 0
Marlin/SanityCheck.h 查看文件

@@ -301,6 +301,16 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
301 301
       #error "SDSORT_CACHE_NAMES requires SDSORT_USES_RAM (which reads the directory into RAM)."
302 302
     #endif
303 303
   #endif
304
+
305
+  #if ENABLED(SDSORT_CACHE_NAMES) && DISABLED(SDSORT_DYNAMIC_RAM)
306
+    #if SDSORT_CACHE_VFATS < 2
307
+      #error "SDSORT_CACHE_VFATS must be 2 or greater!"
308
+    #elif SDSORT_CACHE_VFATS > MAX_VFAT_ENTRIES
309
+      #undef SDSORT_CACHE_VFATS
310
+      #define SDSORT_CACHE_VFATS MAX_VFAT_ENTRIES
311
+      #warning "SDSORT_CACHE_VFATS was reduced to MAX_VFAT_ENTRIES!"
312
+    #endif
313
+  #endif
304 314
 #endif
305 315
 
306 316
 /**

+ 1
- 1
Marlin/SdBaseFile.cpp 查看文件

@@ -1142,7 +1142,7 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1142 1142
       vfat_t* VFAT = (vfat_t*)dir;
1143 1143
       // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1144 1144
       if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1145
-        // TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1145
+        // TODO: Store the filename checksum to verify if a long-filename-unaware system modified the file table.
1146 1146
         n = ((VFAT->sequenceNumber & 0x1F) - 1) * (FILENAME_LENGTH);
1147 1147
         for (uint8_t i = 0; i < FILENAME_LENGTH; i++)
1148 1148
           longFilename[n + i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i - 5] : VFAT->name3[i - 11];

+ 113
- 101
Marlin/SdFatConfig.h 查看文件

@@ -21,114 +21,126 @@
21 21
  */
22 22
 
23 23
 /**
24
+ * SdFatConfig.h
24 25
  * Arduino SdFat Library
25 26
  * Copyright (C) 2009 by William Greiman
26 27
  *
27 28
  * This file is part of the Arduino Sd2Card Library
28 29
  */
30
+
31
+#ifndef _SDFATCONFIG_H_
32
+#define _SDFATCONFIG_H_
33
+
34
+#include "MarlinConfig.h"
35
+
36
+//------------------------------------------------------------------------------
37
+
29 38
 /**
30
- * \file
31
- * \brief configuration definitions
39
+ * To use multiple SD cards set USE_MULTIPLE_CARDS nonzero.
40
+ *
41
+ * Using multiple cards costs 400 - 500  bytes of flash.
42
+ *
43
+ * Each card requires about 550 bytes of SRAM so use of a Mega is recommended.
32 44
  */
33
-#include "Marlin.h"
34
-#if ENABLED(SDSUPPORT)
35
-
36
-#ifndef SdFatConfig_h
37
-  #define SdFatConfig_h
38
-  #include <stdint.h>
39
-  //------------------------------------------------------------------------------
40
-  /**
41
-  * To use multiple SD cards set USE_MULTIPLE_CARDS nonzero.
42
-  *
43
-  * Using multiple cards costs 400 - 500  bytes of flash.
44
-  *
45
-  * Each card requires about 550 bytes of SRAM so use of a Mega is recommended.
46
-  */
47
-  #define USE_MULTIPLE_CARDS 0
48
-  //------------------------------------------------------------------------------
49
-  /**
50
-  * Call flush for endl if ENDL_CALLS_FLUSH is nonzero
51
-  *
52
-  * The standard for iostreams is to call flush.  This is very costly for
53
-  * SdFat.  Each call to flush causes 2048 bytes of I/O to the SD.
54
-  *
55
-  * SdFat has a single 512 byte buffer for SD I/O so it must write the current
56
-  * data block to the SD, read the directory block from the SD, update the
57
-  * directory entry, write the directory block to the SD and read the data
58
-  * block back into the buffer.
59
-  *
60
-  * The SD flash memory controller is not designed for this many rewrites
61
-  * so performance may be reduced by more than a factor of 100.
62
-  *
63
-  * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force
64
-  * all data to be written to the SD.
65
-  */
66
-  #define ENDL_CALLS_FLUSH 0
67
-  //------------------------------------------------------------------------------
68
-  /**
69
-  * Allow use of deprecated functions if ALLOW_DEPRECATED_FUNCTIONS is nonzero
70
-  */
71
-  #define ALLOW_DEPRECATED_FUNCTIONS 1
72
-  //------------------------------------------------------------------------------
73
-  /**
74
-  * Allow FAT12 volumes if FAT12_SUPPORT is nonzero.
75
-  * FAT12 has not been well tested.
76
-  */
77
-  #define FAT12_SUPPORT 0
78
-  //------------------------------------------------------------------------------
79
-  /**
80
-  * SPI init rate for SD initialization commands. Must be 5 (F_CPU/64)
81
-  * or 6 (F_CPU/128).
82
-  */
83
-  #define SPI_SD_INIT_RATE 5
84
-  //------------------------------------------------------------------------------
85
-  /**
86
-  * Set the SS pin high for hardware SPI.  If SS is chip select for another SPI
87
-  * device this will disable that device during the SD init phase.
88
-  */
89
-  #define SET_SPI_SS_HIGH 1
90
-  //------------------------------------------------------------------------------
91
-  /**
92
-  * Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos.
93
-  * Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.
94
-  *
95
-  * MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used
96
-  * on Mega Arduinos.  Software SPI works well with GPS Shield V1.1
97
-  * but many SD cards will fail with GPS Shield V1.0.
98
-  */
99
-  #define MEGA_SOFT_SPI 0
100
-  //------------------------------------------------------------------------------
101
-  /**
102
-  * Set USE_SOFTWARE_SPI nonzero to always use software SPI.
103
-  */
104
-  #define USE_SOFTWARE_SPI 0
105
-  // define software SPI pins so Mega can use unmodified 168/328 shields
106
-  /** Software SPI chip select pin for the SD */
107
-  #define SOFT_SPI_CS_PIN 10
108
-  /** Software SPI Master Out Slave In pin */
109
-  #define SOFT_SPI_MOSI_PIN 11
110
-  /** Software SPI Master In Slave Out pin */
111
-  #define SOFT_SPI_MISO_PIN 12
112
-  /** Software SPI Clock pin */
113
-  #define SOFT_SPI_SCK_PIN 13
114
-  //------------------------------------------------------------------------------
115
-  /**
116
-  * The __cxa_pure_virtual function is an error handler that is invoked when
117
-  * a pure virtual function is called.
118
-  */
119
-  #define USE_CXA_PURE_VIRTUAL 1
120
-
121
-  /** Number of UTF-16 characters per entry */
122
-  #define FILENAME_LENGTH 13
123
-
124
-  /**
125
-  * Defines for long (vfat) filenames
126
-  */
127
-  /** Number of VFAT entries used. Every entry has 13 UTF-16 characters */
128
-  #define MAX_VFAT_ENTRIES (2)
129
-  /** Total size of the buffer used to store the long filenames */
130
-  #define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1)
131
-#endif  // SdFatConfig_h
45
+#define USE_MULTIPLE_CARDS 0
132 46
 
47
+//------------------------------------------------------------------------------
133 48
 
49
+/**
50
+ * Call flush for endl if ENDL_CALLS_FLUSH is nonzero
51
+ *
52
+ * The standard for iostreams is to call flush.  This is very costly for
53
+ * SdFat.  Each call to flush causes 2048 bytes of I/O to the SD.
54
+ *
55
+ * SdFat has a single 512 byte buffer for SD I/O so it must write the current
56
+ * data block to the SD, read the directory block from the SD, update the
57
+ * directory entry, write the directory block to the SD and read the data
58
+ * block back into the buffer.
59
+ *
60
+ * The SD flash memory controller is not designed for this many rewrites
61
+ * so performance may be reduced by more than a factor of 100.
62
+ *
63
+ * If ENDL_CALLS_FLUSH is zero, you must call flush and/or close to force
64
+ * all data to be written to the SD.
65
+ */
66
+#define ENDL_CALLS_FLUSH 0
67
+
68
+//------------------------------------------------------------------------------
69
+
70
+/**
71
+ * Allow use of deprecated functions if ALLOW_DEPRECATED_FUNCTIONS is nonzero
72
+ */
73
+#define ALLOW_DEPRECATED_FUNCTIONS 1
74
+
75
+//------------------------------------------------------------------------------
76
+
77
+/**
78
+ * Allow FAT12 volumes if FAT12_SUPPORT is nonzero.
79
+ * FAT12 has not been well tested.
80
+ */
81
+#define FAT12_SUPPORT 0
82
+
83
+//------------------------------------------------------------------------------
84
+
85
+/**
86
+ * SPI init rate for SD initialization commands. Must be 5 (F_CPU/64)
87
+ * or 6 (F_CPU/128).
88
+ */
89
+#define SPI_SD_INIT_RATE 5
90
+
91
+//------------------------------------------------------------------------------
92
+
93
+/**
94
+ * Set the SS pin high for hardware SPI.  If SS is chip select for another SPI
95
+ * device this will disable that device during the SD init phase.
96
+ */
97
+#define SET_SPI_SS_HIGH 1
98
+
99
+//------------------------------------------------------------------------------
100
+
101
+/**
102
+ * Define MEGA_SOFT_SPI nonzero to use software SPI on Mega Arduinos.
103
+ * Pins used are SS 10, MOSI 11, MISO 12, and SCK 13.
104
+ *
105
+ * MEGA_SOFT_SPI allows an unmodified Adafruit GPS Shield to be used
106
+ * on Mega Arduinos.  Software SPI works well with GPS Shield V1.1
107
+ * but many SD cards will fail with GPS Shield V1.0.
108
+ */
109
+#define MEGA_SOFT_SPI 0
110
+
111
+//------------------------------------------------------------------------------
112
+
113
+// Set USE_SOFTWARE_SPI nonzero to ALWAYS use Software SPI.
114
+#define USE_SOFTWARE_SPI 0
115
+
116
+// Define software SPI pins so Mega can use unmodified 168/328 shields
117
+#define SOFT_SPI_CS_PIN   10 // Software SPI chip select pin for the SD
118
+#define SOFT_SPI_MOSI_PIN 11 // Software SPI Master Out Slave In pin
119
+#define SOFT_SPI_MISO_PIN 12 // Software SPI Master In Slave Out pin
120
+#define SOFT_SPI_SCK_PIN  13 // Software SPI Clock pin
121
+
122
+//------------------------------------------------------------------------------
123
+
124
+/**
125
+ * The __cxa_pure_virtual function is an error handler that is invoked when
126
+ * a pure virtual function is called.
127
+ */
128
+#define USE_CXA_PURE_VIRTUAL 1
129
+
130
+/**
131
+ * Defines for 8.3 and long (vfat) filenames
132
+ */
133
+
134
+#define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry
135
+
136
+// Number of VFAT entries used. Each entry has 13 UTF-16 characters
137
+#if ENABLED(SCROLL_LONG_FILENAMES)
138
+  #define MAX_VFAT_ENTRIES (5)
139
+#else
140
+  #define MAX_VFAT_ENTRIES (2)
134 141
 #endif
142
+
143
+// Total bytes needed to store a single long filename
144
+#define LONG_FILENAME_LENGTH (FILENAME_LENGTH * MAX_VFAT_ENTRIES + 1)
145
+
146
+#endif // _SDFATCONFIG_H_

+ 1
- 1
Marlin/cardreader.h 查看文件

@@ -120,7 +120,7 @@ private:
120 120
           char **sortshort, **sortnames;
121 121
         #else
122 122
           char sortshort[SDSORT_LIMIT][FILENAME_LENGTH];
123
-          char sortnames[SDSORT_LIMIT][LONG_FILENAME_LENGTH];
123
+          char sortnames[SDSORT_LIMIT][SDSORT_CACHE_VFATS * FILENAME_LENGTH + 1];
124 124
         #endif
125 125
       #elif DISABLED(SDSORT_USES_STACK)
126 126
         char sortnames[SDSORT_LIMIT][LONG_FILENAME_LENGTH];

+ 5
- 0
Marlin/example_configurations/AlephObjects/TAZ4/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 6
- 1
Marlin/example_configurations/Anet/A6/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.
@@ -604,7 +609,7 @@
604 609
  */
605 610
 //#define BABYSTEPPING
606 611
 #if ENABLED(BABYSTEPPING)
607
-  //#define BABYSTEP_XY            // Also enable X/Y Babystepping. Not supported on DELTA!
612
+  //#define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
608 613
   #define BABYSTEP_INVERT_Z false    // Change if Z babysteps should go the other way
609 614
   #define BABYSTEP_MULTIPLICATOR 100 // Babysteps are very small. Increase for faster motion.
610 615
   //#define BABYSTEP_ZPROBE_OFFSET   // Enable to combine M851 and Babystepping

+ 5
- 0
Marlin/example_configurations/Anet/A8/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/BQ/Hephestos/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/BQ/Hephestos_2/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -538,6 +540,9 @@
538 540
   // This allows hosts to request long names for files and folders with M33
539 541
   #define LONG_FILENAME_HOST_SUPPORT
540 542
 
543
+  // Enable this option to scroll long filenames in the SD card menu
544
+  //#define SCROLL_LONG_FILENAMES
545
+
541 546
   // This option allows you to abort SD printing when any endstop is triggered.
542 547
   // This feature must be enabled with "M540 S1" or from the LCD menu.
543 548
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/BQ/WITBOX/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 9
- 4
Marlin/example_configurations/Creality/CR-10/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES true   // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.
@@ -604,10 +609,10 @@
604 609
  */
605 610
 #define BABYSTEPPING
606 611
 #if ENABLED(BABYSTEPPING)
607
-  //#define BABYSTEP_XY            // Also enable X/Y Babystepping. Not supported on DELTA!
608
-  #define BABYSTEP_INVERT_Z false  // Change if Z babysteps should go the other way
609
-  #define BABYSTEP_MULTIPLICATOR 10 // Babysteps are very small. Increase for faster motion.
610
-  //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
612
+  //#define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
613
+  #define BABYSTEP_INVERT_Z false    // Change if Z babysteps should go the other way
614
+  #define BABYSTEP_MULTIPLICATOR  10 // Babysteps are very small. Increase for faster motion.
615
+  //#define BABYSTEP_ZPROBE_OFFSET   // Enable to combine M851 and Babystepping
611 616
   #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
612 617
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
613 618
                                         // Note: Extra time may be added to mitigate controller latency.

+ 5
- 0
Marlin/example_configurations/Felix/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 9
- 4
Marlin/example_configurations/Folger Tech/i3-2020/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.
@@ -604,10 +609,10 @@
604 609
  */
605 610
 #define BABYSTEPPING
606 611
 #if ENABLED(BABYSTEPPING)
607
-  //#define BABYSTEP_XY            // Also enable X/Y Babystepping. Not supported on DELTA!
608
-  #define BABYSTEP_INVERT_Z false  // Change if Z babysteps should go the other way
609
-  #define BABYSTEP_MULTIPLICATOR 2 // Babysteps are very small. Increase for faster motion.
610
-  //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
612
+  //#define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
613
+  #define BABYSTEP_INVERT_Z false    // Change if Z babysteps should go the other way
614
+  #define BABYSTEP_MULTIPLICATOR   2 // Babysteps are very small. Increase for faster motion.
615
+  //#define BABYSTEP_ZPROBE_OFFSET   // Enable to combine M851 and Babystepping
611 616
   #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
612 617
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
613 618
                                         // Note: Extra time may be added to mitigate controller latency.

+ 5
- 0
Marlin/example_configurations/Infitary/i3-M508/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/Malyan/M150/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -538,6 +540,9 @@
538 540
   // This allows hosts to request long names for files and folders with M33
539 541
   #define LONG_FILENAME_HOST_SUPPORT
540 542
 
543
+  // Enable this option to scroll long filenames in the SD card menu
544
+  //#define SCROLL_LONG_FILENAMES
545
+
541 546
   // This option allows you to abort SD printing when any endstop is triggered.
542 547
   // This feature must be enabled with "M540 S1" or from the LCD menu.
543 548
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/Sanguinololu/Configuration_adv.h 查看文件

@@ -506,6 +506,8 @@
506 506
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
507 507
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
508 508
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
509
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
510
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
509 511
   #endif
510 512
 
511 513
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -530,6 +532,9 @@
530 532
   // This allows hosts to request long names for files and folders with M33
531 533
   //#define LONG_FILENAME_HOST_SUPPORT
532 534
 
535
+  // Enable this option to scroll long filenames in the SD card menu
536
+  //#define SCROLL_LONG_FILENAMES
537
+
533 538
   // This option allows you to abort SD printing when any endstop is triggered.
534 539
   // This feature must be enabled with "M540 S1" or from the LCD menu.
535 540
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/Velleman/K8200/Configuration_adv.h 查看文件

@@ -530,6 +530,8 @@
530 530
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
531 531
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
532 532
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
533
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
534
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
533 535
   #endif
534 536
 
535 537
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -551,6 +553,9 @@
551 553
   // This allows hosts to request long names for files and folders with M33
552 554
   #define LONG_FILENAME_HOST_SUPPORT
553 555
 
556
+  // Enable this option to scroll long filenames in the SD card menu
557
+  //#define SCROLL_LONG_FILENAMES
558
+
554 559
   // This option allows you to abort SD printing when any endstop is triggered.
555 560
   // This feature must be enabled with "M540 S1" or from the LCD menu.
556 561
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/Velleman/K8400/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 9
- 4
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h 查看文件

@@ -519,6 +519,8 @@
519 519
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
520 520
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
521 521
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
522
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
523
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
522 524
   #endif
523 525
 
524 526
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -543,6 +545,9 @@
543 545
   // This allows hosts to request long names for files and folders with M33
544 546
   //#define LONG_FILENAME_HOST_SUPPORT
545 547
 
548
+  // Enable this option to scroll long filenames in the SD card menu
549
+  //#define SCROLL_LONG_FILENAMES
550
+
546 551
   // This option allows you to abort SD printing when any endstop is triggered.
547 552
   // This feature must be enabled with "M540 S1" or from the LCD menu.
548 553
   // To have any effect, endstops must be enabled during SD printing.
@@ -606,10 +611,10 @@
606 611
  */
607 612
 //#define BABYSTEPPING
608 613
 #if ENABLED(BABYSTEPPING)
609
-  //#define BABYSTEP_XY            // Also enable X/Y Babystepping. Not supported on DELTA!
610
-  #define BABYSTEP_INVERT_Z false  // Change if Z babysteps should go the other way
611
-  #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion.
612
-  //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
614
+  //#define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
615
+  #define BABYSTEP_INVERT_Z false    // Change if Z babysteps should go the other way
616
+  #define BABYSTEP_MULTIPLICATOR   1 // Babysteps are very small. Increase for faster motion.
617
+  //#define BABYSTEP_ZPROBE_OFFSET   // Enable to combine M851 and Babystepping
613 618
   //#define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
614 619
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
615 620
                                         // Note: Extra time may be added to mitigate controller latency.

+ 5
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h 查看文件

@@ -519,6 +519,8 @@
519 519
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
520 520
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
521 521
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
522
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
523
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
522 524
   #endif
523 525
 
524 526
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -543,6 +545,9 @@
543 545
   // This allows hosts to request long names for files and folders with M33
544 546
   //#define LONG_FILENAME_HOST_SUPPORT
545 547
 
548
+  // Enable this option to scroll long filenames in the SD card menu
549
+  //#define SCROLL_LONG_FILENAMES
550
+
546 551
   // This option allows you to abort SD printing when any endstop is triggered.
547 552
   // This feature must be enabled with "M540 S1" or from the LCD menu.
548 553
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h 查看文件

@@ -519,6 +519,8 @@
519 519
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
520 520
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
521 521
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
522
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
523
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
522 524
   #endif
523 525
 
524 526
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -543,6 +545,9 @@
543 545
   // This allows hosts to request long names for files and folders with M33
544 546
   //#define LONG_FILENAME_HOST_SUPPORT
545 547
 
548
+  // Enable this option to scroll long filenames in the SD card menu
549
+  //#define SCROLL_LONG_FILENAMES
550
+
546 551
   // This option allows you to abort SD printing when any endstop is triggered.
547 552
   // This feature must be enabled with "M540 S1" or from the LCD menu.
548 553
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h 查看文件

@@ -519,6 +519,8 @@
519 519
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
520 520
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
521 521
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
522
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
523
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
522 524
   #endif
523 525
 
524 526
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -543,6 +545,9 @@
543 545
   // This allows hosts to request long names for files and folders with M33
544 546
   //#define LONG_FILENAME_HOST_SUPPORT
545 547
 
548
+  // Enable this option to scroll long filenames in the SD card menu
549
+  //#define SCROLL_LONG_FILENAMES
550
+
546 551
   // This option allows you to abort SD printing when any endstop is triggered.
547 552
   // This feature must be enabled with "M540 S1" or from the LCD menu.
548 553
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h 查看文件

@@ -524,6 +524,8 @@
524 524
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
525 525
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
526 526
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
527
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
528
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
527 529
   #endif
528 530
 
529 531
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -548,6 +550,9 @@
548 550
   // This allows hosts to request long names for files and folders with M33
549 551
   //#define LONG_FILENAME_HOST_SUPPORT
550 552
 
553
+  // Enable this option to scroll long filenames in the SD card menu
554
+  //#define SCROLL_LONG_FILENAMES
555
+
551 556
   // This option allows you to abort SD printing when any endstop is triggered.
552 557
   // This feature must be enabled with "M540 S1" or from the LCD menu.
553 558
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h 查看文件

@@ -519,6 +519,8 @@
519 519
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
520 520
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
521 521
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
522
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
523
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
522 524
   #endif
523 525
 
524 526
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -543,6 +545,9 @@
543 545
   // This allows hosts to request long names for files and folders with M33
544 546
   //#define LONG_FILENAME_HOST_SUPPORT
545 547
 
548
+  // Enable this option to scroll long filenames in the SD card menu
549
+  //#define SCROLL_LONG_FILENAMES
550
+
546 551
   // This option allows you to abort SD printing when any endstop is triggered.
547 552
   // This feature must be enabled with "M540 S1" or from the LCD menu.
548 553
   // To have any effect, endstops must be enabled during SD printing.

+ 9
- 4
Marlin/example_configurations/gCreate/gMax1.5+/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.
@@ -604,10 +609,10 @@
604 609
  */
605 610
 #define BABYSTEPPING
606 611
 #if ENABLED(BABYSTEPPING)
607
-  //#define BABYSTEP_XY            // Also enable X/Y Babystepping. Not supported on DELTA!
608
-  #define BABYSTEP_INVERT_Z false  // Change if Z babysteps should go the other way
609
-  #define BABYSTEP_MULTIPLICATOR 1 // Babysteps are very small. Increase for faster motion.
610
-  //#define BABYSTEP_ZPROBE_OFFSET // Enable to combine M851 and Babystepping
612
+  //#define BABYSTEP_XY              // Also enable X/Y Babystepping. Not supported on DELTA!
613
+  #define BABYSTEP_INVERT_Z false    // Change if Z babysteps should go the other way
614
+  #define BABYSTEP_MULTIPLICATOR   1 // Babysteps are very small. Increase for faster motion.
615
+  //#define BABYSTEP_ZPROBE_OFFSET   // Enable to combine M851 and Babystepping
611 616
   #define DOUBLECLICK_FOR_Z_BABYSTEPPING // Double-click on the Status Screen for Z Babystepping.
612 617
   #define DOUBLECLICK_MAX_INTERVAL 1250 // Maximum interval between clicks, in milliseconds.
613 618
                                         // Note: Extra time may be added to mitigate controller latency.

+ 5
- 0
Marlin/example_configurations/makibox/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 5
- 0
Marlin/example_configurations/wt150/Configuration_adv.h 查看文件

@@ -517,6 +517,8 @@
517 517
     #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
518 518
     #define SDSORT_CACHE_NAMES false  // Keep sorted items in RAM longer for speedy performance. Most expensive option.
519 519
     #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
520
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
521
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
520 522
   #endif
521 523
 
522 524
   // Show a progress bar on HD44780 LCDs for SD printing
@@ -541,6 +543,9 @@
541 543
   // This allows hosts to request long names for files and folders with M33
542 544
   //#define LONG_FILENAME_HOST_SUPPORT
543 545
 
546
+  // Enable this option to scroll long filenames in the SD card menu
547
+  //#define SCROLL_LONG_FILENAMES
548
+
544 549
   // This option allows you to abort SD printing when any endstop is triggered.
545 550
   // This feature must be enabled with "M540 S1" or from the LCD menu.
546 551
   // To have any effect, endstops must be enabled during SD printing.

+ 18
- 3
Marlin/ultralcd.cpp 查看文件

@@ -77,13 +77,18 @@ int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_spe
77 77
   #endif
78 78
 #endif
79 79
 
80
-uint8_t lcd_status_message_level;
80
+uint8_t lcd_status_update_delay = 1, // First update one loop delayed
81
+        lcd_status_message_level;    // Higher level blocks lower level
81 82
 char lcd_status_message[3 * (LCD_WIDTH) + 1] = WELCOME_MSG; // worst case is kana with up to 3*LCD_WIDTH+1
82 83
 
83 84
 #if ENABLED(STATUS_MESSAGE_SCROLLING)
84 85
   uint8_t status_scroll_pos = 0;
85 86
 #endif
86 87
 
88
+#if ENABLED(SCROLL_LONG_FILENAMES)
89
+  uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash;
90
+#endif
91
+
87 92
 #if ENABLED(DOGLCD)
88 93
   #include "ultralcd_impl_DOGM.h"
89 94
   #include <U8glib.h>
@@ -4675,7 +4680,6 @@ void lcd_update() {
4675 4680
 
4676 4681
     // We arrive here every ~100ms when idling often enough.
4677 4682
     // Instead of tracking the changes simply redraw the Info Screen ~1 time a second.
4678
-    static int8_t lcd_status_update_delay = 1; // first update one loop delayed
4679 4683
     if (
4680 4684
       #if ENABLED(ULTIPANEL)
4681 4685
         currentScreen == lcd_status_screen &&
@@ -4691,6 +4695,17 @@ void lcd_update() {
4691 4695
       lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
4692 4696
     }
4693 4697
 
4698
+    #if ENABLED(SCROLL_LONG_FILENAMES)
4699
+      // If scrolling of long file names is enabled and we are in the sd card menu,
4700
+      // cause a refresh to occur until all the text has scrolled into view.
4701
+      if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) {
4702
+        lcd_status_update_delay = 6;
4703
+        lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
4704
+        filename_scroll_pos++;
4705
+        return_to_status_ms = ms + LCD_TIMEOUT_TO_STATUS;
4706
+      }
4707
+    #endif
4708
+
4694 4709
     // then we want to use 1/2 of the time only.
4695 4710
     uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
4696 4711
 
@@ -4775,7 +4790,7 @@ void lcd_update() {
4775 4790
   } // ELAPSED(ms, next_lcd_update_ms)
4776 4791
 }
4777 4792
 
4778
-void pad_message_string() {
4793
+inline void pad_message_string() {
4779 4794
   uint8_t i = 0, j = 0;
4780 4795
   char c;
4781 4796
   while ((c = lcd_status_message[i]) && j < LCD_WIDTH) {

+ 23
- 6
Marlin/ultralcd_impl_DOGM.h 查看文件

@@ -934,19 +934,36 @@ static void lcd_implementation_status_screen() {
934 934
 
935 935
       if (!PAGE_CONTAINS(row_y1, row_y2)) return;
936 936
 
937
-      uint8_t n = LCD_WIDTH - (START_COL) - 1;
937
+      constexpr uint8_t maxlen = LCD_WIDTH - (START_COL) - 1;
938
+      const char *outstr = longFilename[0] ? longFilename : filename;
938 939
       if (longFilename[0]) {
939
-        filename = longFilename;
940
-        longFilename[n] = '\0'; // cutoff at screen edge
940
+        #if ENABLED(SCROLL_LONG_FILENAMES)
941
+          if (isSelected) {
942
+            uint8_t name_hash = row;
943
+            for (uint8_t l = FILENAME_LENGTH; l--;)
944
+              name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l];  // rotate, xor
945
+            if (filename_scroll_hash != name_hash) {                            // If the hash changed...
946
+              filename_scroll_hash = name_hash;                                 // Save the new hash
947
+              filename_scroll_max = max(0, lcd_strlen(longFilename) - maxlen);  // Update the scroll limit
948
+              filename_scroll_pos = 0;                                          // Reset scroll to the start
949
+              lcd_status_update_delay = 8;                                      // Don't scroll right away
950
+            }
951
+            outstr += filename_scroll_pos;
952
+          }
953
+        #else
954
+          longFilename[maxlen] = '\0'; // cutoff at screen edge
955
+        #endif
941 956
       }
942 957
 
943 958
       if (isDir) lcd_print(LCD_STR_FOLDER[0]);
944 959
 
945
-      while (char c = *filename) {
960
+      char c;
961
+      uint8_t n = maxlen;
962
+      while (n && (c = *outstr)) {
946 963
         n -= lcd_print_and_count(c);
947
-        filename++;
964
+        ++outstr;
948 965
       }
949
-      while (n--) u8g.print(' ');
966
+      while (n) { --n; u8g.print(' '); }
950 967
     }
951 968
 
952 969
     #define lcd_implementation_drawmenu_sdfile(sel, row, pstr, filename, longFilename) _drawmenu_sd(sel, row, pstr, filename, longFilename, false)

+ 25
- 6
Marlin/ultralcd_impl_HD44780.h 查看文件

@@ -988,18 +988,37 @@ static void lcd_implementation_status_screen() {
988 988
 
989 989
     static void lcd_implementation_drawmenu_sd(const bool sel, const uint8_t row, const char* const pstr, const char* filename, char* const longFilename, const uint8_t concat, const char post_char) {
990 990
       UNUSED(pstr);
991
-      uint8_t n = LCD_WIDTH - concat;
992 991
       lcd.setCursor(0, row);
993 992
       lcd.print(sel ? '>' : ' ');
993
+
994
+      uint8_t n = LCD_WIDTH - concat;
995
+      const char *outstr = longFilename[0] ? longFilename : filename;
994 996
       if (longFilename[0]) {
995
-        filename = longFilename;
996
-        longFilename[n] = '\0';
997
+        #if ENABLED(SCROLL_LONG_FILENAMES)
998
+          if (sel) {
999
+            uint8_t name_hash = row;
1000
+            for (uint8_t l = FILENAME_LENGTH; l--;)
1001
+              name_hash = ((name_hash << 1) | (name_hash >> 7)) ^ filename[l];  // rotate, xor
1002
+            if (filename_scroll_hash != name_hash) {                            // If the hash changed...
1003
+              filename_scroll_hash = name_hash;                                 // Save the new hash
1004
+              filename_scroll_max = max(0, lcd_strlen(longFilename) - n);  // Update the scroll limit
1005
+              filename_scroll_pos = 0;                                          // Reset scroll to the start
1006
+              lcd_status_update_delay = 8;                                      // Don't scroll right away
1007
+            }
1008
+            outstr += filename_scroll_pos;
1009
+          }
1010
+        #else
1011
+          longFilename[n] = '\0'; // cutoff at screen edge
1012
+        #endif
997 1013
       }
998
-      while (char c = *filename) {
1014
+
1015
+      char c;
1016
+      while (n && (c = *outstr)) {
999 1017
         n -= charset_mapper(c);
1000
-        filename++;
1018
+        ++outstr;
1001 1019
       }
1002
-      while (n--) lcd.write(' ');
1020
+      while (n) { --n; lcd.write(' '); }
1021
+
1003 1022
       lcd.print(post_char);
1004 1023
     }
1005 1024
 

Loading…
取消
儲存