Browse Source

Merge branch 'revert-1154-sd_sorting' into Marlin_v1

daid 10 years ago
parent
commit
a5c059dcf5

+ 0
- 1
Marlin/Configuration_adv.h View File

@@ -292,7 +292,6 @@
292 292
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
293 293
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
294 294
 
295
-//#define SDCARD_SORT_ALPHA // Sort SD file listings in ASCII order. Find additional options in cardreader.h
296 295
 #define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
297 296
 // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
298 297
 // using:

+ 1
- 3
Marlin/SdFatConfig.h View File

@@ -111,14 +111,12 @@ uint8_t const SOFT_SPI_SCK_PIN = 13;
111 111
 /**
112 112
  * Defines for long (vfat) filenames
113 113
  */
114
-/** Number of UTF-16 characters per entry */
115
-#define FILENAME_LENGTH 13
116 114
 /** Number of VFAT entries used. Every entry has 13 UTF-16 characters */
117 115
 #define MAX_VFAT_ENTRIES (2)
118 116
 /** Number of UTF-16 characters per entry */
119 117
 #define FILENAME_LENGTH 13
120 118
 /** Total size of the buffer used to store the long filenames */
121
-#define LONG_FILENAME_LENGTH (FILENAME_LENGTH*MAX_VFAT_ENTRIES+1)
119
+#define LONG_FILENAME_LENGTH (13*MAX_VFAT_ENTRIES+1)
122 120
 #endif  // SdFatConfig_h
123 121
 
124 122
 

+ 28
- 185
Marlin/cardreader.cpp View File

@@ -11,9 +11,6 @@
11 11
 
12 12
 CardReader::CardReader()
13 13
 {
14
-  #ifdef SDCARD_SORT_ALPHA
15
-   sort_count = 0;
16
-  #endif
17 14
    filesize = 0;
18 15
    sdpos = 0;
19 16
    sdprinting = false;
@@ -36,15 +33,19 @@ CardReader::CardReader()
36 33
   autostart_atmillis=millis()+5000;
37 34
 }
38 35
 
39
-char *createFilename(char *buffer, const dir_t &p) //buffer>12characters
36
+char *createFilename(char *buffer,const dir_t &p) //buffer>12characters
40 37
 {
41 38
   char *pos=buffer;
42
-  for (uint8_t i = 0; i < 11; i++) {
43
-    if (p.name[i] == ' ') continue;
44
-    if (i == 8) *pos++ = '.';
45
-    *pos++ = p.name[i];
39
+  for (uint8_t i = 0; i < 11; i++) 
40
+  {
41
+    if (p.name[i] == ' ')continue;
42
+    if (i == 8) 
43
+    {
44
+      *pos++='.';
45
+    }
46
+    *pos++=p.name[i];
46 47
   }
47
-  *pos++ = 0;
48
+  *pos++=0;
48 49
   return buffer;
49 50
 }
50 51
 
@@ -52,15 +53,15 @@ char *createFilename(char *buffer, const dir_t &p) //buffer>12characters
52 53
 void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/)
53 54
 {
54 55
   dir_t p;
55
-  uint8_t cnt=0;
56
+ uint8_t cnt=0;
56 57
  
57 58
   while (parent.readDir(p, longFilename) > 0)
58 59
   {
59 60
     if( DIR_IS_SUBDIR(&p) && lsAction!=LS_Count && lsAction!=LS_GetFilename) // hence LS_SerialPrint
60 61
     {
61 62
 
62
-      char path[FILENAME_LENGTH*2];
63
-      char lfilename[FILENAME_LENGTH];
63
+      char path[13*2];
64
+      char lfilename[13];
64 65
       createFilename(lfilename,p);
65 66
       
66 67
       path[0]=0;
@@ -86,6 +87,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
86 87
       }
87 88
       lsDive(path,dir);
88 89
       //close done automatically by destructor of SdFile
90
+
91
+      
89 92
     }
90 93
     else
91 94
     {
@@ -97,7 +100,8 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
97 100
 
98 101
       if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue;
99 102
       filenameIsDir=DIR_IS_SUBDIR(&p);
100
-
103
+      
104
+      
101 105
       if(!filenameIsDir)
102 106
       {
103 107
         if(p.name[8]!='G') continue;
@@ -121,6 +125,7 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
121 125
         }
122 126
         else if (cnt == nrFiles) return;
123 127
         cnt++;
128
+        
124 129
       }
125 130
     }
126 131
   }
@@ -129,6 +134,9 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
129 134
 void CardReader::ls() 
130 135
 {
131 136
   lsAction=LS_SerialPrint;
137
+  if(lsAction==LS_Count)
138
+  nrFiles=0;
139
+
132 140
   root.rewind();
133 141
   lsDive("",root);
134 142
 }
@@ -175,9 +183,6 @@ void CardReader::initsd()
175 183
   }
176 184
   workDir=root;
177 185
   curDir=&root;
178
-  #ifdef SDCARD_SORT_ALPHA
179
-    presort();
180
-  #endif
181 186
   /*
182 187
   if(!workDir.openRoot(&volume))
183 188
   {
@@ -194,10 +199,8 @@ void CardReader::setroot()
194 199
     SERIAL_ECHOLNPGM(MSG_SD_WORKDIR_FAIL);
195 200
   }*/
196 201
   workDir=root;
202
+  
197 203
   curDir=&workDir;
198
-  #ifdef SDCARD_SORT_ALPHA
199
-    presort();
200
-  #endif
201 204
 }
202 205
 void CardReader::release()
203 206
 {
@@ -210,9 +213,6 @@ void CardReader::startFileprint()
210 213
   if(cardOK)
211 214
   {
212 215
     sdprinting = true;
213
-    #ifdef SDCARD_SORT_ALPHA
214
-      flush_presort();
215
-    #endif
216 216
   }
217 217
 }
218 218
 
@@ -241,7 +241,7 @@ void CardReader::getAbsFilename(char *t)
241 241
     while(*t!=0 && cnt< MAXPATHNAMELENGTH) 
242 242
     {t++;cnt++;}  //crawl counter forward.
243 243
   }
244
-  if(cnt<MAXPATHNAMELENGTH-FILENAME_LENGTH)
244
+  if(cnt<MAXPATHNAMELENGTH-13)
245 245
     file.getFilename(t);
246 246
   else
247 247
     t[0]=0;
@@ -311,7 +311,7 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/)
311 311
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end-name));
312 312
       if(dirname_end>0 && dirname_end>dirname_start)
313 313
       {
314
-        char subdirname[FILENAME_LENGTH];
314
+        char subdirname[13];
315 315
         strncpy(subdirname, dirname_start, dirname_end-dirname_start);
316 316
         subdirname[dirname_end-dirname_start]=0;
317 317
         SERIAL_ECHOLN(subdirname);
@@ -408,7 +408,7 @@ void CardReader::removeFile(char* name)
408 408
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end-name));
409 409
       if(dirname_end>0 && dirname_end>dirname_start)
410 410
       {
411
-        char subdirname[FILENAME_LENGTH];
411
+        char subdirname[13];
412 412
         strncpy(subdirname, dirname_start, dirname_end-dirname_start);
413 413
         subdirname[dirname_end-dirname_start]=0;
414 414
         SERIAL_ECHOLN(subdirname);
@@ -446,9 +446,6 @@ void CardReader::removeFile(char* name)
446 446
       SERIAL_PROTOCOLPGM("File deleted:");
447 447
       SERIAL_PROTOCOLLN(fname);
448 448
       sdpos = 0;
449
-      #ifdef SDCARD_SORT_ALPHA
450
-        presort();
451
-      #endif
452 449
     }
453 450
     else
454 451
     {
@@ -564,14 +561,6 @@ void CardReader::closefile(bool store_location)
564 561
 
565 562
 void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/)
566 563
 {
567
-  #if defined(SDCARD_SORT_ALPHA) && SORT_USES_RAM && SORT_USES_MORE_RAM
568
-    if (nr < sort_count) {
569
-      strcpy(filename, sortshort[nr]);
570
-      strcpy(longFilename, sortnames[nr]);
571
-      filenameIsDir = isDir[nr];
572
-      return;
573
-    }
574
-  #endif
575 564
   curDir=&workDir;
576 565
   lsAction=LS_GetFilename;
577 566
   nrFiles=nr;
@@ -595,7 +584,7 @@ void CardReader::chdir(const char * relpath)
595 584
 {
596 585
   SdFile newfile;
597 586
   SdFile *parent=&root;
598
-
587
+  
599 588
   if(workDir.isOpen())
600 589
     parent=&workDir;
601 590
   
@@ -613,164 +602,21 @@ void CardReader::chdir(const char * relpath)
613 602
       workDirParents[0]=*parent;
614 603
     }
615 604
     workDir=newfile;
616
-    #ifdef SDCARD_SORT_ALPHA
617
-      presort();
618
-    #endif
619 605
   }
620 606
 }
621 607
 
622 608
 void CardReader::updir()
623 609
 {
624
-  if (workDirDepth > 0)
610
+  if(workDirDepth > 0)
625 611
   {
626 612
     --workDirDepth;
627 613
     workDir = workDirParents[0];
614
+    int d;
628 615
     for (int d = 0; d < workDirDepth; d++)
629 616
       workDirParents[d] = workDirParents[d+1];
630
-    #ifdef SDCARD_SORT_ALPHA
631
-      presort();
632
-    #endif
633
-  }
634
-}
635
-
636
-#ifdef SDCARD_SORT_ALPHA
637
-
638
-/**
639
- * Get the name of a file in the current directory by sort-index
640
- */
641
-void CardReader::getfilename_sorted(const uint16_t nr) {
642
-  getfilename(nr < sort_count ? sort_order[nr] : nr);
643
-}
644
-
645
-/**
646
- * Read all the files and produce a sort key
647
- *
648
- * We can do this in 3 ways...
649
- *  - Minimal RAM: Read two filenames at a time sorting along...
650
- *  - Some RAM: Buffer the directory and return filenames from RAM
651
- *  - Some RAM: Buffer the directory just for this sort
652
- */
653
-void CardReader::presort()
654
-{
655
-  flush_presort();
656
-
657
-  uint16_t fileCnt = getnrfilenames();
658
-  if (fileCnt > 0) {
659
-
660
-    if (fileCnt > SORT_LIMIT) fileCnt = SORT_LIMIT;
661
-
662
-    #if SORT_USES_RAM
663
-      #if SORT_USES_MORE_RAM
664
-        sortshort = (char**)calloc(fileCnt, sizeof(char*));
665
-        sortnames = (char**)calloc(fileCnt, sizeof(char*));
666
-      #else
667
-        char *sortnames[fileCnt];
668
-      #endif
669
-    #else
670
-      char name1[LONG_FILENAME_LENGTH+1];
671
-    #endif
672
-
673
-    #if FOLDER_SORTING != 0
674
-      #if SORT_USES_RAM && SORT_USES_MORE_RAM
675
-        isDir = (uint8_t*)calloc(fileCnt, sizeof(uint8_t));
676
-      #else
677
-        uint8_t isDir[fileCnt];
678
-      #endif
679
-    #endif
680
-
681
-    sort_order = new uint8_t[fileCnt];
682
-
683
-    if (fileCnt > 1) {
684
-
685
-      // Init sort order. If using RAM then read all filenames now.
686
-      for (uint16_t i=0; i<fileCnt; i++) {
687
-        sort_order[i] = i;
688
-        #if SORT_USES_RAM
689
-          getfilename(i);
690
-          sortnames[i] = strdup(longFilename[0] ? longFilename : filename);
691
-          #if SORT_USES_MORE_RAM
692
-            sortshort[i] = strdup(filename);
693
-          #endif
694
-          // char out[30];
695
-          // sprintf_P(out, PSTR("---- %i %s %s"), i, filenameIsDir ? "D" : " ", sortnames[i]);
696
-          // SERIAL_ECHOLN(out);
697
-          #if FOLDER_SORTING != 0
698
-            isDir[i] = filenameIsDir;
699
-          #endif
700
-        #endif
701
-      }
702
-
703
-      // Bubble Sort
704
-      for (uint16_t i=fileCnt; --i;) {
705
-        bool cmp, didSwap = false;
706
-        for (uint16_t j=0; j<i; ++j) {
707
-          uint16_t s1 = j, s2 = j+1, o1 = sort_order[s1], o2 = sort_order[s2];
708
-          #if SORT_USES_RAM
709
-            #if FOLDER_SORTING != 0
710
-              cmp = (isDir[o1] == isDir[o2]) ? (strcasecmp(sortnames[o1], sortnames[o2]) > 0) : isDir[FOLDER_SORTING > 0 ? o1 : o2];
711
-            #else
712
-              cmp = strcasecmp(sortnames[o1], sortnames[o2]) > 0;
713
-            #endif
714
-          #else
715
-            getfilename(o1);
716
-            strcpy(name1, longFilename[0] ? longFilename : filename);
717
-            #if FOLDER_SORTING != 0
718
-              bool dir1 = filenameIsDir;
719
-            #endif
720
-            getfilename(o2);
721
-            char *name2 = longFilename[0] ? longFilename : filename;
722
-            #if FOLDER_SORTING != 0
723
-              cmp = (dir1 == filenameIsDir) ? (strcasecmp(name1, name2) > 0) : (FOLDER_SORTING > 0 ? dir1 : !dir1);
724
-            #else
725
-              cmp = strcasecmp(name1, name2) > 0;
726
-            #endif
727
-          #endif
728
-          if (cmp) {
729
-            sort_order[s1] = o2;
730
-            sort_order[s2] = o1;
731
-            didSwap = true;
732
-          }
733
-        }
734
-        if (!didSwap) break;
735
-      }
736
-
737
-      #if SORT_USES_RAM && !SORT_USES_MORE_RAM
738
-        for (uint16_t i=0; i<fileCnt; ++i) free(sortnames[i]);
739
-      #endif
740
-    }
741
-    else {
742
-      sort_order[0] = 0;
743
-      #if SORT_USES_RAM && SORT_USES_MORE_RAM
744
-        sortnames = (char**)malloc(sizeof(char*));
745
-        sortshort = (char**)malloc(sizeof(char*));
746
-        isDir = (uint8_t*)malloc(sizeof(uint8_t));
747
-        getfilename(0);
748
-        sortnames[0] = strdup(longFilename[0] ? longFilename : filename);
749
-        sortshort[0] = strdup(filename);
750
-        isDir[0] = filenameIsDir;
751
-      #endif
752
-    }
753
-
754
-    sort_count = fileCnt;
755
-  }
756
-}
757
-
758
-void CardReader::flush_presort() {
759
-  if (sort_count > 0) {
760
-    #if SORT_USES_RAM && SORT_USES_MORE_RAM
761
-      for (uint8_t i=0; i<sort_count; ++i) {
762
-        free(sortshort[i]);
763
-        free(sortnames[i]);
764
-      }
765
-      free(sortshort);
766
-      free(sortnames);
767
-    #endif
768
-    delete sort_order;
769
-    sort_count = 0;
770 617
   }
771 618
 }
772 619
 
773
-#endif // SDCARD_SORT_ALPHA
774 620
 
775 621
 void CardReader::printingHasFinished()
776 622
 {
@@ -794,9 +640,6 @@ void CardReader::printingHasFinished()
794 640
           enquecommand_P(PSTR(SD_FINISHED_RELEASECOMMAND));
795 641
       }
796 642
       autotempShutdown();
797
-      #ifdef SDCARD_SORT_ALPHA
798
-        presort();
799
-      #endif
800 643
     }
801 644
 }
802 645
 #endif //SDSUPPORT

+ 6
- 28
Marlin/cardreader.h View File

@@ -3,14 +3,7 @@
3 3
 
4 4
 #ifdef SDSUPPORT
5 5
 
6
-#define MAX_DIR_DEPTH 10          // Maximum folder depth
7
-
8
-#ifdef SDCARD_SORT_ALPHA
9
-  #define SORT_USES_RAM false      // Buffer while sorting, else re-read from SD
10
-  #define SORT_USES_MORE_RAM false // Always keep the directory in RAM
11
-  #define SORT_LIMIT 256           // Maximum number of sorted items
12
-  #define FOLDER_SORTING -1        // -1=above  0=none  1=below
13
-#endif
6
+#define MAX_DIR_DEPTH 10
14 7
 
15 8
 #include "SdFile.h"
16 9
 enum LsAction {LS_SerialPrint,LS_Count,LS_GetFilename};
@@ -46,12 +39,6 @@ public:
46 39
   void updir();
47 40
   void setroot();
48 41
 
49
-#ifdef SDCARD_SORT_ALPHA
50
-  void presort();
51
-  void flush_presort();
52
-  void getfilename_sorted(const uint16_t nr);
53
-#endif
54
-
55 42
 
56 43
   FORCE_INLINE bool isFileOpen() { return file.isOpen(); }
57 44
   FORCE_INLINE bool eof() { return sdpos>=filesize ;};
@@ -63,29 +50,20 @@ public:
63 50
 public:
64 51
   bool saving;
65 52
   bool logging;
66
-  bool sdprinting;
67
-  bool cardOK;
68
-  char filename[FILENAME_LENGTH];
53
+  bool sdprinting ;  
54
+  bool cardOK ;
55
+  char filename[13];
69 56
   char longFilename[LONG_FILENAME_LENGTH];
70 57
   bool filenameIsDir;
71 58
   int lastnr; //last number of the autostart;
72 59
 private:
73 60
   SdFile root,*curDir,workDir,workDirParents[MAX_DIR_DEPTH];
74 61
   uint16_t workDirDepth;
75
-#ifdef SDCARD_SORT_ALPHA
76
-  uint16_t sort_count;
77
-  uint8_t *sort_order;
78
-  #if SORT_USES_MORE_RAM
79
-    char **sortshort;
80
-    char **sortnames;
81
-    uint8_t *isDir;
82
-  #endif
83
-#endif
84 62
   Sd2Card card;
85 63
   SdVolume volume;
86 64
   SdFile file;
87 65
   #define SD_PROCEDURE_DEPTH 1
88
-  #define MAXPATHNAMELENGTH (FILENAME_LENGTH*MAX_DIR_DEPTH+MAX_DIR_DEPTH+1)
66
+  #define MAXPATHNAMELENGTH (13*MAX_DIR_DEPTH+MAX_DIR_DEPTH+1)
89 67
   uint8_t file_subcall_ctr;
90 68
   uint32_t filespos[SD_PROCEDURE_DEPTH];
91 69
   char filenames[SD_PROCEDURE_DEPTH][MAXPATHNAMELENGTH];
@@ -97,7 +75,7 @@ private:
97 75
   bool autostart_stilltocheck; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
98 76
   
99 77
   LsAction lsAction; //stored for recursion.
100
-  uint16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
78
+  int16_t nrFiles; //counter for the files in the current directory and recycled as position counter for getting the nrFiles'th name in the directory.
101 79
   char* diveDirName;
102 80
   void lsDive(const char *prepend, SdFile parent, const char * const match=NULL);
103 81
 };

+ 0
- 1
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -295,7 +295,6 @@
295 295
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
296 296
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
297 297
 
298
-//#define SDCARD_SORT_ALPHA // Sort SD file listings in ASCII order. Find additional options in cardreader.h
299 298
 #define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
300 299
 // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
301 300
 // using:

+ 0
- 1
Marlin/example_configurations/delta/Configuration_adv.h View File

@@ -287,7 +287,6 @@
287 287
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
288 288
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
289 289
 
290
-//#define SDCARD_SORT_ALPHA // Sort SD file listings in ASCII order. Find additional options in cardreader.h
291 290
 #define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the filesystem block order. 
292 291
 // if a file is deleted, it frees a block. hence, the order is not purely cronological. To still have auto0.g accessible, there is again the option to do that.
293 292
 // using:

+ 0
- 1
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -291,7 +291,6 @@
291 291
 #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
292 292
 #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
293 293
 
294
-//#define SDCARD_SORT_ALPHA // Sort SD file listings in ASCII order. Find additional options in cardreader.h
295 294
 #define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
296 295
 // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
297 296
 // using:

+ 11
- 18
Marlin/ultralcd.cpp View File

@@ -886,9 +886,9 @@ void lcd_sdcard_menu()
886 886
     card.getWorkDirName();
887 887
     if(card.filename[0]=='/')
888 888
     {
889
-      #if SDCARDDETECT == -1
889
+#if SDCARDDETECT == -1
890 890
         MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);
891
-      #endif
891
+#endif
892 892
     }else{
893 893
         MENU_ITEM(function, LCD_STR_FOLDER "..", lcd_sd_updir);
894 894
     }
@@ -897,23 +897,16 @@ void lcd_sdcard_menu()
897 897
     {
898 898
         if (_menuItemNr == _lineNr)
899 899
         {
900
-            #if defined(SDCARD_RATHERRECENTFIRST) && !defined(SDCARD_SORT_ALPHA)
901
-              int nr = fileCnt-1-i;
900
+            #ifndef SDCARD_RATHERRECENTFIRST
901
+              card.getfilename(i);
902 902
             #else
903
-              int nr = i;
903
+              card.getfilename(fileCnt-1-i);
904 904
             #endif
905
-
906
-            #ifdef SDCARD_SORT_ALPHA
907
-              card.getfilename_sorted(nr);
908
-            #else
909
-              card.getfilename(nr);
910
-            #endif
911
-
912
-            if (card.filenameIsDir) {
913
-              MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
914
-            }
915
-            else {
916
-              MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
905
+            if (card.filenameIsDir)
906
+            {
907
+                MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
908
+            }else{
909
+                MENU_ITEM(sdfile, MSG_CARD_MENU, card.filename, card.longFilename);
917 910
             }
918 911
         }else{
919 912
             MENU_ITEM_DUMMY();
@@ -1090,7 +1083,7 @@ void lcd_init()
1090 1083
   #endif // SR_LCD_2W_NL
1091 1084
 #endif//!NEWPANEL
1092 1085
 
1093
-#if defined(SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1086
+#if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0)
1094 1087
     pinMode(SDCARDDETECT,INPUT);
1095 1088
     WRITE(SDCARDDETECT, HIGH);
1096 1089
     lcd_oldcardstatus = IS_SD_INSERTED;

Loading…
Cancel
Save