|
@@ -18,8 +18,6 @@
|
18
|
18
|
* <http://www.gnu.org/licenses/>.
|
19
|
19
|
*/
|
20
|
20
|
|
21
|
|
-#define SERIAL MSerial
|
22
|
|
-
|
23
|
21
|
#include "Marlin.h"
|
24
|
22
|
#ifdef SDSUPPORT
|
25
|
23
|
|
|
@@ -345,38 +343,38 @@ int8_t SdBaseFile::lsPrintNext( uint8_t flags, uint8_t indent) {
|
345
|
343
|
&& DIR_IS_FILE_OR_SUBDIR(&dir)) break;
|
346
|
344
|
}
|
347
|
345
|
// indent for dir level
|
348
|
|
- for (uint8_t i = 0; i < indent; i++) MSerial.write(' ');
|
|
346
|
+ for (uint8_t i = 0; i < indent; i++) SERIAL.write(' ');
|
349
|
347
|
|
350
|
348
|
// print name
|
351
|
349
|
for (uint8_t i = 0; i < 11; i++) {
|
352
|
350
|
if (dir.name[i] == ' ')continue;
|
353
|
351
|
if (i == 8) {
|
354
|
|
- MSerial.write('.');
|
|
352
|
+ SERIAL.write('.');
|
355
|
353
|
w++;
|
356
|
354
|
}
|
357
|
|
- MSerial.write(dir.name[i]);
|
|
355
|
+ SERIAL.write(dir.name[i]);
|
358
|
356
|
w++;
|
359
|
357
|
}
|
360
|
358
|
if (DIR_IS_SUBDIR(&dir)) {
|
361
|
|
- MSerial.write('/');
|
|
359
|
+ SERIAL.write('/');
|
362
|
360
|
w++;
|
363
|
361
|
}
|
364
|
362
|
if (flags & (LS_DATE | LS_SIZE)) {
|
365
|
|
- while (w++ < 14) MSerial.write(' ');
|
|
363
|
+ while (w++ < 14) SERIAL.write(' ');
|
366
|
364
|
}
|
367
|
365
|
// print modify date/time if requested
|
368
|
366
|
if (flags & LS_DATE) {
|
369
|
|
- MSerial.write(' ');
|
|
367
|
+ SERIAL.write(' ');
|
370
|
368
|
printFatDate( dir.lastWriteDate);
|
371
|
|
- MSerial.write(' ');
|
|
369
|
+ SERIAL.write(' ');
|
372
|
370
|
printFatTime( dir.lastWriteTime);
|
373
|
371
|
}
|
374
|
372
|
// print size if requested
|
375
|
373
|
if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) {
|
376
|
|
- MSerial.write(' ');
|
377
|
|
- MSerial.print(dir.fileSize);
|
|
374
|
+ SERIAL.write(' ');
|
|
375
|
+ SERIAL.print(dir.fileSize);
|
378
|
376
|
}
|
379
|
|
- MSerial.println();
|
|
377
|
+ SERIAL.println();
|
380
|
378
|
return DIR_IS_FILE(&dir) ? 1 : 2;
|
381
|
379
|
}
|
382
|
380
|
//------------------------------------------------------------------------------
|
|
@@ -947,26 +945,26 @@ void SdBaseFile::printDirName(const dir_t& dir,
|
947
|
945
|
for (uint8_t i = 0; i < 11; i++) {
|
948
|
946
|
if (dir.name[i] == ' ')continue;
|
949
|
947
|
if (i == 8) {
|
950
|
|
- MSerial.write('.');
|
|
948
|
+ SERIAL.write('.');
|
951
|
949
|
w++;
|
952
|
950
|
}
|
953
|
|
- MSerial.write(dir.name[i]);
|
|
951
|
+ SERIAL.write(dir.name[i]);
|
954
|
952
|
w++;
|
955
|
953
|
}
|
956
|
954
|
if (DIR_IS_SUBDIR(&dir) && printSlash) {
|
957
|
|
- MSerial.write('/');
|
|
955
|
+ SERIAL.write('/');
|
958
|
956
|
w++;
|
959
|
957
|
}
|
960
|
958
|
while (w < width) {
|
961
|
|
- MSerial.write(' ');
|
|
959
|
+ SERIAL.write(' ');
|
962
|
960
|
w++;
|
963
|
961
|
}
|
964
|
962
|
}
|
965
|
963
|
//------------------------------------------------------------------------------
|
966
|
964
|
// print uint8_t with width 2
|
967
|
965
|
static void print2u( uint8_t v) {
|
968
|
|
- if (v < 10) MSerial.write('0');
|
969
|
|
- MSerial.print(v, DEC);
|
|
966
|
+ if (v < 10) SERIAL.write('0');
|
|
967
|
+ SERIAL.print(v, DEC);
|
970
|
968
|
}
|
971
|
969
|
//------------------------------------------------------------------------------
|
972
|
970
|
/** %Print a directory date field to Serial.
|
|
@@ -985,10 +983,10 @@ static void print2u( uint8_t v) {
|
985
|
983
|
* \param[in] fatDate The date field from a directory entry.
|
986
|
984
|
*/
|
987
|
985
|
void SdBaseFile::printFatDate(uint16_t fatDate) {
|
988
|
|
- MSerial.print(FAT_YEAR(fatDate));
|
989
|
|
- MSerial.write('-');
|
|
986
|
+ SERIAL.print(FAT_YEAR(fatDate));
|
|
987
|
+ SERIAL.write('-');
|
990
|
988
|
print2u( FAT_MONTH(fatDate));
|
991
|
|
- MSerial.write('-');
|
|
989
|
+ SERIAL.write('-');
|
992
|
990
|
print2u( FAT_DAY(fatDate));
|
993
|
991
|
}
|
994
|
992
|
|
|
@@ -1002,9 +1000,9 @@ void SdBaseFile::printFatDate(uint16_t fatDate) {
|
1002
|
1000
|
*/
|
1003
|
1001
|
void SdBaseFile::printFatTime( uint16_t fatTime) {
|
1004
|
1002
|
print2u( FAT_HOUR(fatTime));
|
1005
|
|
- MSerial.write(':');
|
|
1003
|
+ SERIAL.write(':');
|
1006
|
1004
|
print2u( FAT_MINUTE(fatTime));
|
1007
|
|
- MSerial.write(':');
|
|
1005
|
+ SERIAL.write(':');
|
1008
|
1006
|
print2u( FAT_SECOND(fatTime));
|
1009
|
1007
|
}
|
1010
|
1008
|
//------------------------------------------------------------------------------
|
|
@@ -1016,7 +1014,7 @@ void SdBaseFile::printFatTime( uint16_t fatTime) {
|
1016
|
1014
|
bool SdBaseFile::printName() {
|
1017
|
1015
|
char name[13];
|
1018
|
1016
|
if (!getFilename(name)) return false;
|
1019
|
|
- MSerial.print(name);
|
|
1017
|
+ SERIAL.print(name);
|
1020
|
1018
|
return true;
|
1021
|
1019
|
}
|
1022
|
1020
|
//------------------------------------------------------------------------------
|
|
@@ -1790,4 +1788,4 @@ void (*SdBaseFile::oldDateTime_)(uint16_t& date, uint16_t& time) = 0; // NOLINT
|
1790
|
1788
|
#endif // ALLOW_DEPRECATED_FUNCTIONS
|
1791
|
1789
|
|
1792
|
1790
|
|
1793
|
|
-#endif
|
|
1791
|
+#endif
|