MYSERIAL => MYSERIAL0

For cleaner diffing with Marlin 2.0.x.
This commit is contained in:
Scott Lahteine 2018-02-14 02:53:55 -06:00
parent d89a61bd51
commit c93dab2307
10 changed files with 50 additions and 65 deletions

View file

@ -339,38 +339,38 @@ int8_t SdBaseFile::lsPrintNext(uint8_t flags, uint8_t indent) {
&& DIR_IS_FILE_OR_SUBDIR(&dir)) break;
}
// indent for dir level
for (uint8_t i = 0; i < indent; i++) MYSERIAL.write(' ');
for (uint8_t i = 0; i < indent; i++) MYSERIAL0.write(' ');
// print name
for (uint8_t i = 0; i < 11; i++) {
if (dir.name[i] == ' ')continue;
if (i == 8) {
MYSERIAL.write('.');
MYSERIAL0.write('.');
w++;
}
MYSERIAL.write(dir.name[i]);
MYSERIAL0.write(dir.name[i]);
w++;
}
if (DIR_IS_SUBDIR(&dir)) {
MYSERIAL.write('/');
MYSERIAL0.write('/');
w++;
}
if (flags & (LS_DATE | LS_SIZE)) {
while (w++ < 14) MYSERIAL.write(' ');
while (w++ < 14) MYSERIAL0.write(' ');
}
// print modify date/time if requested
if (flags & LS_DATE) {
MYSERIAL.write(' ');
MYSERIAL0.write(' ');
printFatDate(dir.lastWriteDate);
MYSERIAL.write(' ');
MYSERIAL0.write(' ');
printFatTime(dir.lastWriteTime);
}
// print size if requested
if (!DIR_IS_SUBDIR(&dir) && (flags & LS_SIZE)) {
MYSERIAL.write(' ');
MYSERIAL.print(dir.fileSize);
MYSERIAL0.write(' ');
MYSERIAL0.print(dir.fileSize);
}
MYSERIAL.println();
MYSERIAL0.println();
return DIR_IS_FILE(&dir) ? 1 : 2;
}
@ -905,8 +905,8 @@ int SdBaseFile::peek() {
// print uint8_t with width 2
static void print2u(uint8_t v) {
if (v < 10) MYSERIAL.write('0');
MYSERIAL.print(v, DEC);
if (v < 10) MYSERIAL0.write('0');
MYSERIAL0.print(v, DEC);
}
/**
@ -927,10 +927,10 @@ static void print2u(uint8_t v) {
* \param[in] fatDate The date field from a directory entry.
*/
void SdBaseFile::printFatDate(uint16_t fatDate) {
MYSERIAL.print(FAT_YEAR(fatDate));
MYSERIAL.write('-');
MYSERIAL0.print(FAT_YEAR(fatDate));
MYSERIAL0.write('-');
print2u(FAT_MONTH(fatDate));
MYSERIAL.write('-');
MYSERIAL0.write('-');
print2u(FAT_DAY(fatDate));
}
@ -945,9 +945,9 @@ void SdBaseFile::printFatDate(uint16_t fatDate) {
*/
void SdBaseFile::printFatTime(uint16_t fatTime) {
print2u(FAT_HOUR(fatTime));
MYSERIAL.write(':');
MYSERIAL0.write(':');
print2u(FAT_MINUTE(fatTime));
MYSERIAL.write(':');
MYSERIAL0.write(':');
print2u(FAT_SECOND(fatTime));
}
@ -959,7 +959,7 @@ void SdBaseFile::printFatTime(uint16_t fatTime) {
bool SdBaseFile::printName() {
char name[FILENAME_LENGTH];
if (!getFilename(name)) return false;
MYSERIAL.print(name);
MYSERIAL0.print(name);
return true;
}