diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 4739dc4a..a1671848 100755 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -5818,7 +5818,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT) ### M27 - Get SD status M27: Report SD print status */ case 27: - card.getStatus(); + card.getStatus(code_seen('L')); break; /*! diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index e228c523..2140a09a 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -502,31 +502,38 @@ uint32_t CardReader::getFileSize() return filesize; } -void CardReader::getStatus() +void CardReader::getStatus(bool arg_L) { - if(sdprinting) - { - if (isPrintPaused) { - SERIAL_PROTOCOLLNPGM("SD print paused"); - } - else if (saved_printing) { - SERIAL_PROTOCOLLNPGM("Print saved"); - } - else { - SERIAL_PROTOCOLLN(LONGEST_FILENAME); - SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE - SERIAL_PROTOCOL(sdpos); - SERIAL_PROTOCOL('/'); - SERIAL_PROTOCOLLN(filesize); - uint16_t time = ( _millis() - starttime ) / 60000U; - SERIAL_PROTOCOL(itostr2(time/60)); - SERIAL_PROTOCOL(':'); - SERIAL_PROTOCOLLN(itostr2(time%60)); - } - } - else { - SERIAL_PROTOCOLLNPGM("Not SD printing"); - } + if (isPrintPaused) + { + if (saved_printing && (saved_printing_type == PRINTING_TYPE_SD)) + SERIAL_PROTOCOLLNPGM("SD print paused"); + else + SERIAL_PROTOCOLLNPGM("Print saved"); + } + else if (sdprinting) + { + if (arg_L) + { + SERIAL_PROTOCOL('/'); + for (uint8_t i = 0; i < getWorkDirDepth(); i++) + printf_P(PSTR("%s/"), dir_names[i]); + puts(filename); + } + else + SERIAL_PROTOCOLLN(LONGEST_FILENAME); + + SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE + SERIAL_PROTOCOL(sdpos); + SERIAL_PROTOCOL('/'); + SERIAL_PROTOCOLLN(filesize); + uint16_t time = ( _millis() - starttime ) / 60000U; + SERIAL_PROTOCOL(itostr2(time/60)); + SERIAL_PROTOCOL(':'); + SERIAL_PROTOCOLLN(itostr2(time%60)); + } + else + SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { diff --git a/Firmware/cardreader.h b/Firmware/cardreader.h index 25e97882..40098d3c 100644 --- a/Firmware/cardreader.h +++ b/Firmware/cardreader.h @@ -26,7 +26,7 @@ public: void release(); void startFileprint(); uint32_t getFileSize(); - void getStatus(); + void getStatus(bool arg_L); void printingHasFinished(); void getfilename(uint16_t nr, const char* const match=NULL);