Browse Source

simplified M20 with size

Bob-the-Kuhn 8 years ago
parent
commit
1b12fea0fa
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      Marlin/cardreader.cpp

+ 6
- 2
Marlin/cardreader.cpp View File

74
  * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
74
  * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
75
  *   LS_Count       - Add +1 to nrFiles for every file within the parent
75
  *   LS_Count       - Add +1 to nrFiles for every file within the parent
76
  *   LS_GetFilename - Get the filename of the file indexed by nrFiles
76
  *   LS_GetFilename - Get the filename of the file indexed by nrFiles
77
- *   LS_SerialPrint - Print the full path of each file to serial output
77
+ *   LS_SerialPrint - Print the full path and size of each file to serial output
78
  */
78
  */
79
 void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
79
 void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
80
   dir_t p;
80
   dir_t p;
133
         case LS_Count:
133
         case LS_Count:
134
           nrFiles++;
134
           nrFiles++;
135
           break;
135
           break;
136
+
136
         case LS_SerialPrint:
137
         case LS_SerialPrint:
137
           createFilename(filename, p);
138
           createFilename(filename, p);
138
           SERIAL_PROTOCOL(prepend);
139
           SERIAL_PROTOCOL(prepend);
139
-          SERIAL_PROTOCOLLN(filename);
140
+          SERIAL_PROTOCOL(filename);
141
+          SERIAL_PROTOCOLCHAR(' ');
142
+          SERIAL_PROTOCOLLN(p.fileSize);
140
           break;
143
           break;
144
+
141
         case LS_GetFilename:
145
         case LS_GetFilename:
142
           createFilename(filename, p);
146
           createFilename(filename, p);
143
           if (match != NULL) {
147
           if (match != NULL) {

Loading…
Cancel
Save