Followup to AUTO_REPORT_SD_STATUS

Followup to #9832
This commit is contained in:
Scott Lahteine 2018-03-07 00:13:25 -06:00
parent d7aed2fe4f
commit b198b49d15
3 changed files with 20 additions and 13 deletions

View file

@ -1410,6 +1410,11 @@
*/ */
#define AUTO_REPORT_TEMPERATURES #define AUTO_REPORT_TEMPERATURES
/**
* Auto-report SdCard status with M27 S<seconds>
*/
//#define AUTO_REPORT_SD_STATUS
/** /**
* Include capabilities in M115 output * Include capabilities in M115 output
*/ */

View file

@ -85,7 +85,7 @@
* M24 - Start/resume SD print. (Requires SDSUPPORT) * M24 - Start/resume SD print. (Requires SDSUPPORT)
* M25 - Pause SD print. (Requires SDSUPPORT) * M25 - Pause SD print. (Requires SDSUPPORT)
* M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT) * M26 - Set SD position in bytes: "M26 S12345". (Requires SDSUPPORT)
* M27 - Report SD print status. (Requires SDSUPPORT) With 'S<seconds>' sets the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS) * M27 - Report SD print status. (Requires SDSUPPORT) Or, with 'S<seconds>' set the SD status auto-report interval. (Requires AUTO_REPORT_SD_STATUS)
* M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT) * M28 - Start SD write: "M28 /path/file.gco". (Requires SDSUPPORT)
* M29 - Stop SD write. (Requires SDSUPPORT) * M29 - Stop SD write. (Requires SDSUPPORT)
* M30 - Delete file from SD: "M30 /path/file.gco" * M30 - Delete file from SD: "M30 /path/file.gco"

View file

@ -107,22 +107,24 @@ void GcodeSuite::M26() {
} }
/** /**
* M27: Get SD Card status * M27: Get SD Card status or set the SD status auto-report interval.
*/ */
void GcodeSuite::M27() { void GcodeSuite::M27() {
card.getStatus(
#if NUM_SERIAL > 1
command_queue_port[cmd_queue_index_r]
#endif
);
#if ENABLED(AUTO_REPORT_SD_STATUS) #if ENABLED(AUTO_REPORT_SD_STATUS)
if (parser.seenval('S')) if (parser.seenval('S')) {
card.set_auto_report_interval(parser.value_byte() card.set_auto_report_interval(parser.value_byte()
#if NUM_SERIAL > 1 #if NUM_SERIAL > 1
, command_queue_port[cmd_queue_index_r] , command_queue_port[cmd_queue_index_r]
#endif #endif
); );
}
else
#endif #endif
card.getStatus(
#if NUM_SERIAL > 1
command_queue_port[cmd_queue_index_r]
#endif
);
} }
/** /**