Skip to content

Commit

Permalink
#35 improved
Browse files Browse the repository at this point in the history
  • Loading branch information
ursoft committed Mar 15, 2020
1 parent 406d4df commit 358b95e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,9 @@ void CardReader::cdroot() {
*/
void CardReader::getfilename_sorted(const uint16_t nr) {
selectFileByIndex(
#if ENABLED(SDSORT_GCODE)
sort_alpha &&
#endif
//#if ENABLED(SDSORT_GCODE)
// sort_alpha &&
//#endif
(nr < sort_count) ? sort_order[nr] : nr
);
}
Expand Down Expand Up @@ -972,9 +972,9 @@ void CardReader::cdroot() {
selectFileByIndex(i);
SET_SORTNAME(i);
SET_SORTSHORT(i);
// char out[30];
// sprintf_P(out, PSTR("---- %i %s %s"), i, flag.filenameIsDir ? "D" : " ", sortnames[i]);
// SERIAL_ECHOLN(out);
char out[30];
sprintf_P(out, PSTR("---- %i %s %s"), i, flag.filenameIsDir ? "D" : " ", sortnames[i]);
SERIAL_ECHOLN(out);
#if HAS_FOLDER_SORTING
const uint16_t bit = i & 0x07, ind = i >> 3;
if (bit == 0) isDir[ind] = 0x00;
Expand All @@ -987,8 +987,7 @@ void CardReader::cdroot() {
// Sorting may be turned off
#if ENABLED(SDSORT_GCODE)
if (!sort_alpha) {
for (uint16_t i = 0; i < fileCnt; i++)
sort_order[i] = i;
sort_count = fileCnt;
} else
#endif
for (uint16_t i = fileCnt; --i;) {
Expand Down

0 comments on commit 358b95e

Please sign in to comment.