No 'ls' if media isn't mounted

This commit is contained in:
Scott Lahteine
2020-09-04 19:57:07 -05:00
committed by Scott Lahteine
parent d94b5b5ad0
commit f7cb9455c8
3 changed files with 12 additions and 5 deletions

View File

@ -276,8 +276,10 @@ void CardReader::printListing(SdFile parent, const char * const prepend/*=nullpt
// List all files on the SD card
//
void CardReader::ls() {
root.rewind();
printListing(root);
if (flag.mounted) {
root.rewind();
printListing(root);
}
}
#if ENABLED(LONG_FILENAME_HOST_SUPPORT)