Announce SD file open

Requested in #17110
This commit is contained in:
Scott Lahteine 2020-03-10 22:54:07 -05:00
parent bd44f041e8
commit eb6c992bfb

View File

@ -451,10 +451,12 @@ void openFailed(const char * const fname) {
void announceOpen(const uint8_t doing, const char * const path) { void announceOpen(const uint8_t doing, const char * const path) {
if (doing) { if (doing) {
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_ECHO_START(); SERIAL_ECHO_START();
SERIAL_ECHOPGM("Now "); SERIAL_ECHOPGM("Now ");
serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh")); serialprintPGM(doing == 1 ? PSTR("doing") : PSTR("fresh"));
SERIAL_ECHOLNPAIR(" file: ", path); SERIAL_ECHOLNPAIR(" file: ", path);
PORT_RESTORE();
} }
} }
@ -511,8 +513,11 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*
if (file.open(curDir, fname, O_READ)) { if (file.open(curDir, fname, O_READ)) {
filesize = file.fileSize(); filesize = file.fileSize();
sdpos = 0; sdpos = 0;
PORT_REDIRECT(SERIAL_BOTH);
SERIAL_ECHOLNPAIR(STR_SD_FILE_OPENED, fname, STR_SD_SIZE, filesize); SERIAL_ECHOLNPAIR(STR_SD_FILE_OPENED, fname, STR_SD_SIZE, filesize);
SERIAL_ECHOLNPGM(STR_SD_FILE_SELECTED); SERIAL_ECHOLNPGM(STR_SD_FILE_SELECTED);
PORT_RESTORE();
selectFileByName(fname); selectFileByName(fname);
ui.set_status(longFilename[0] ? longFilename : fname); ui.set_status(longFilename[0] ? longFilename : fname);