Procházet zdrojové kódy

Merge pull request #8122 from Bob-the-Kuhn/2.0.x-restore-Re-ARM-RepRap-Discount-Full-Graphics-fix-(partial-solution)

2.0.x - Restore fix for garbaged display on Re-ARM with RepRap Full Graphics Smart Controller
Bob-the-Kuhn před 7 roky
rodič
revize
6e5f13a5c2
No account linked to committer's email address

+ 3
- 1
Marlin/src/lcd/ultralcd.cpp Zobrazit soubor

3775
     void lcd_sdcard_menu() {
3775
     void lcd_sdcard_menu() {
3776
       ENCODER_DIRECTION_MENUS();
3776
       ENCODER_DIRECTION_MENUS();
3777
 
3777
 
3778
-      const uint16_t fileCnt = card.getnrfilenames();
3778
+      const uint16_t fileCnt = card.get_num_Files();  // Only access SD card if sort not active
3779
+                                                      // This minimizes garbage on RepRap Discount Full Graphics Smart Controller
3780
+                                                      // when using the Re-ARM card.
3779
       START_MENU();
3781
       START_MENU();
3780
       MENU_BACK(MSG_MAIN);
3782
       MENU_BACK(MSG_MAIN);
3781
       card.getWorkDirName();
3783
       card.getWorkDirName();

+ 19
- 0
Marlin/src/pins/pins_AZSMZ_MINI.h Zobrazit soubor

112
 #define ENET_TXD0          P1_0
112
 #define ENET_TXD0          P1_0
113
 #define ENET_TXD1          P1_1
113
 #define ENET_TXD1          P1_1
114
 
114
 
115
+
116
+#if (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && !defined(SDCARD_SORT_ALPHA)) // needed because of shared SPI
117
+  #define SDCARD_SORT_ALPHA         // Using SORT feature to keep one directory level in RAM
118
+                                    // When going up/down directory levels the SD card is
119
+                                    // accessed but the garbage/lines are removed when the
120
+                                    // LCD updates
121
+
122
+  #define SDSORT_LIMIT       256    // Maximum number of sorted items (10-256). Costs 27 bytes each.
123
+  #define FOLDER_SORTING     -1     // -1=above  0=none  1=below
124
+  #define SDSORT_GCODE       false  // Allow turning sorting on/off with LCD and M34 g-code.
125
+  #define SDSORT_USES_RAM    true   // Pre-allocate a static array for faster pre-sorting.
126
+  #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
127
+  #define SDSORT_CACHE_NAMES true   // Keep sorted items in RAM longer for speedy performance. Most expensive option.
128
+  #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
129
+  #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
130
+                                    // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
131
+  #define MAX_VFAT_ENTRIES SDSORT_CACHE_VFATS
132
+#endif
133
+
115
 /**
134
 /**
116
  *  PWMs
135
  *  PWMs
117
  *
136
  *

+ 19
- 0
Marlin/src/pins/pins_MKS_SBASE.h Zobrazit soubor

174
 #define ENET_TXD0          P1_0   // J12-11
174
 #define ENET_TXD0          P1_0   // J12-11
175
 #define ENET_TXD1          P1_1   // J12-12
175
 #define ENET_TXD1          P1_1   // J12-12
176
 
176
 
177
+
178
+#if (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && !defined(SDCARD_SORT_ALPHA)) // needed because of shared SPI
179
+  #define SDCARD_SORT_ALPHA         // Using SORT feature to keep one directory level in RAM
180
+                                    // When going up/down directory levels the SD card is
181
+                                    // accessed but the garbage/lines are removed when the
182
+                                    // LCD updates
183
+
184
+  #define SDSORT_LIMIT       256    // Maximum number of sorted items (10-256). Costs 27 bytes each.
185
+  #define FOLDER_SORTING     -1     // -1=above  0=none  1=below
186
+  #define SDSORT_GCODE       false  // Allow turning sorting on/off with LCD and M34 g-code.
187
+  #define SDSORT_USES_RAM    true   // Pre-allocate a static array for faster pre-sorting.
188
+  #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
189
+  #define SDSORT_CACHE_NAMES true   // Keep sorted items in RAM longer for speedy performance. Most expensive option.
190
+  #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
191
+  #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
192
+                                    // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
193
+  #define MAX_VFAT_ENTRIES SDSORT_CACHE_VFATS
194
+#endif
195
+
177
 /**
196
 /**
178
  *  PWMs
197
  *  PWMs
179
  *
198
  *

+ 18
- 0
Marlin/src/pins/pins_RAMPS_RE_ARM.h Zobrazit soubor

259
     //#define SHIFT_EN            P1_22  // J5-4 & AUX-4
259
     //#define SHIFT_EN            P1_22  // J5-4 & AUX-4
260
   #endif
260
   #endif
261
 
261
 
262
+  #if (ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && !defined(SDCARD_SORT_ALPHA)) // needed because of shared SPI
263
+    #define SDCARD_SORT_ALPHA         // Using SORT feature to keep one directory level in RAM
264
+                                      // When going up/down directory levels the SD card is
265
+                                      // accessed but the garbage/lines are removed when the
266
+                                      // LCD updates
267
+
268
+    #define SDSORT_LIMIT       256    // Maximum number of sorted items (10-256). Costs 27 bytes each.
269
+    #define FOLDER_SORTING     -1     // -1=above  0=none  1=below
270
+    #define SDSORT_GCODE       false  // Allow turning sorting on/off with LCD and M34 g-code.
271
+    #define SDSORT_USES_RAM    true   // Pre-allocate a static array for faster pre-sorting.
272
+    #define SDSORT_USES_STACK  false  // Prefer the stack for pre-sorting to give back some SRAM. (Negated by next 2 options.)
273
+    #define SDSORT_CACHE_NAMES true   // Keep sorted items in RAM longer for speedy performance. Most expensive option.
274
+    #define SDSORT_DYNAMIC_RAM false  // Use dynamic allocation (within SD menus). Least expensive option. Set SDSORT_LIMIT before use!
275
+    #define SDSORT_CACHE_VFATS 2      // Maximum number of 13-byte VFAT entries to use for sorting.
276
+                                      // Note: Only affects SCROLL_LONG_FILENAMES with SDSORT_CACHE_NAMES but not SDSORT_DYNAMIC_RAM.
277
+    #define MAX_VFAT_ENTRIES SDSORT_CACHE_VFATS
278
+  #endif
279
+
262
   #if ENABLED(VIKI2) || ENABLED(miniVIKI)
280
   #if ENABLED(VIKI2) || ENABLED(miniVIKI)
263
     // #define LCD_SCREEN_ROT_180
281
     // #define LCD_SCREEN_ROT_180
264
 
282
 

+ 3
- 0
Marlin/src/sd/SdFatConfig.h Zobrazit soubor

134
 #define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry
134
 #define FILENAME_LENGTH 13 // Number of UTF-16 characters per entry
135
 
135
 
136
 // Number of VFAT entries used. Each entry has 13 UTF-16 characters
136
 // Number of VFAT entries used. Each entry has 13 UTF-16 characters
137
+#ifdef MAX_VFAT_ENTRIES
138
+  #undef MAX_VFAT_ENTRIES
139
+#endif  
137
 #if ENABLED(SCROLL_LONG_FILENAMES)
140
 #if ENABLED(SCROLL_LONG_FILENAMES)
138
   #define MAX_VFAT_ENTRIES (5)
141
   #define MAX_VFAT_ENTRIES (5)
139
 #else
142
 #else

+ 2
- 2
Marlin/src/sd/cardreader.cpp Zobrazit soubor

747
                 strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
747
                 strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
748
                 sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0';
748
                 sortnames[i][SORTED_LONGNAME_MAXLEN - 1] = '\0';
749
               #else
749
               #else
750
-                strcpy(sortnames[i], SORTED_LONGNAME_MAXLEN);
750
+                strncpy(sortnames[i], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
751
               #endif
751
               #endif
752
               #if ENABLED(SDSORT_CACHE_NAMES)
752
               #if ENABLED(SDSORT_CACHE_NAMES)
753
                 strcpy(sortshort[i], filename);
753
                 strcpy(sortshort[i], filename);
849
               strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
849
               strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
850
               sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0';
850
               sortnames[0][SORTED_LONGNAME_MAXLEN - 1] = '\0';
851
             #else
851
             #else
852
-              strcpy(sortnames[0], SORTED_LONGNAME_MAXLEN);
852
+              strncpy(sortnames[0], LONGEST_FILENAME, SORTED_LONGNAME_MAXLEN);
853
             #endif
853
             #endif
854
             #if ENABLED(SDSORT_CACHE_NAMES)
854
             #if ENABLED(SDSORT_CACHE_NAMES)
855
               strcpy(sortshort[0], filename);
855
               strcpy(sortshort[0], filename);

Loading…
Zrušit
Uložit