Browse Source

Folder sorting finished

Alex Voinea 5 years ago
parent
commit
66e51aa298
1 changed files with 4 additions and 2 deletions
  1. 4 2
      Firmware/cardreader.cpp

+ 4 - 2
Firmware/cardreader.cpp

@@ -831,8 +831,10 @@ void CardReader::presort() {
 
 #define _SORT_CMP_NODIR() (strcasecmp(name2, name1) > 0)
 #define _SORT_CMP_TIME_NODIR() (((modification_date_bckp == modificationDate) && (modification_time_bckp < modificationTime)) || (modification_date_bckp < modificationDate))
-#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? !dir1 : dir1))
-#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? !dir1 : dir1))
+#if HAS_FOLDER_SORTING
+#define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs > 0 ? filenameIsDir : !filenameIsDir))
+#define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? filenameIsDir : !filenameIsDir))
+#endif
 
 			uint16_t counter = 0;
 			uint16_t total = 0;