simplified M20 with size

This commit is contained in:
Bob-the-Kuhn 2017-04-12 14:35:31 -05:00 committed by Scott Lahteine
parent b236562354
commit 1b12fea0fa

View file

@ -74,7 +74,7 @@ char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
* Dive into a folder and recurse depth-first to perform a pre-set operation lsAction: * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
* LS_Count - Add +1 to nrFiles for every file within the parent * LS_Count - Add +1 to nrFiles for every file within the parent
* LS_GetFilename - Get the filename of the file indexed by nrFiles * LS_GetFilename - Get the filename of the file indexed by nrFiles
* LS_SerialPrint - Print the full path of each file to serial output * LS_SerialPrint - Print the full path and size of each file to serial output
*/ */
void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) { void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
dir_t p; dir_t p;
@ -133,11 +133,15 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
case LS_Count: case LS_Count:
nrFiles++; nrFiles++;
break; break;
case LS_SerialPrint: case LS_SerialPrint:
createFilename(filename, p); createFilename(filename, p);
SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(prepend);
SERIAL_PROTOCOLLN(filename); SERIAL_PROTOCOL(filename);
SERIAL_PROTOCOLCHAR(' ');
SERIAL_PROTOCOLLN(p.fileSize);
break; break;
case LS_GetFilename: case LS_GetFilename:
createFilename(filename, p); createFilename(filename, p);
if (match != NULL) { if (match != NULL) {