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

@ -31,9 +31,13 @@
* M20: List SD card to serial output
*/
void GcodeSuite::M20() {
SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST);
card.ls();
SERIAL_ECHOLNPGM(STR_END_FILE_LIST);
if (card.flag.mounted) {
SERIAL_ECHOLNPGM(STR_BEGIN_FILE_LIST);
card.ls();
SERIAL_ECHOLNPGM(STR_END_FILE_LIST);
}
else
SERIAL_ECHO_MSG(STR_NO_MEDIA);
}
#endif // SDSUPPORT