瀏覽代碼

Followup to AUTO_REPORT_SD_STATUS

Followup to #9832
Scott Lahteine 6 年之前
父節點
當前提交
b198b49d15
共有 3 個檔案被更改,包括 20 行新增13 行删除
  1. 5
    0
      Marlin/Configuration_adv.h
  2. 1
    1
      Marlin/src/gcode/gcode.h
  3. 14
    12
      Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp

+ 5
- 0
Marlin/Configuration_adv.h 查看文件

@@ -1411,6 +1411,11 @@
1411 1411
 #define AUTO_REPORT_TEMPERATURES
1412 1412
 
1413 1413
 /**
1414
+ * Auto-report SdCard status with M27 S<seconds>
1415
+ */
1416
+//#define AUTO_REPORT_SD_STATUS
1417
+
1418
+/**
1414 1419
  * Include capabilities in M115 output
1415 1420
  */
1416 1421
 #define EXTENDED_CAPABILITIES_REPORT

+ 1
- 1
Marlin/src/gcode/gcode.h 查看文件

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

+ 14
- 12
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M928.cpp 查看文件

@@ -107,22 +107,24 @@ void GcodeSuite::M26() {
107 107
 }
108 108
 
109 109
 /**
110
- * M27: Get SD Card status
110
+ * M27: Get SD Card status or set the SD status auto-report interval.
111 111
  */
112 112
 void GcodeSuite::M27() {
113
-  card.getStatus(
114
-    #if NUM_SERIAL > 1
115
-      command_queue_port[cmd_queue_index_r]
116
-    #endif
117
-  );
118 113
   #if ENABLED(AUTO_REPORT_SD_STATUS)
119
-  if (parser.seenval('S'))
120
-    card.set_auto_report_interval(parser.value_byte()
121
-      #if NUM_SERIAL > 1
122
-        , command_queue_port[cmd_queue_index_r]
123
-      #endif
124
-    );
114
+    if (parser.seenval('S')) {
115
+      card.set_auto_report_interval(parser.value_byte()
116
+        #if NUM_SERIAL > 1
117
+          , command_queue_port[cmd_queue_index_r]
118
+        #endif
119
+      );
120
+    }
121
+    else
125 122
   #endif
123
+      card.getStatus(
124
+        #if NUM_SERIAL > 1
125
+          command_queue_port[cmd_queue_index_r]
126
+        #endif
127
+      );
126 128
 }
127 129
 
128 130
 /**

Loading…
取消
儲存