瀏覽代碼

Add suspend_auto_report flag to suppress auto-report

Scott Lahteine 7 年之前
父節點
當前提交
eb212ae073
共有 3 個檔案被更改,包括 21 行新增8 行删除
  1. 15
    8
      Marlin/src/Marlin.cpp
  2. 4
    0
      Marlin/src/Marlin.h
  3. 2
    0
      Marlin/src/inc/Conditionals_post.h

+ 15
- 8
Marlin/src/Marlin.cpp 查看文件

@@ -187,6 +187,10 @@ volatile bool wait_for_heatup = true;
187 187
   volatile bool wait_for_user = false;
188 188
 #endif
189 189
 
190
+#if HAS_AUTO_REPORTING
191
+  bool suspend_auto_report; // = false
192
+#endif
193
+
190 194
 // Inactivity shutdown
191 195
 millis_t max_inactive_time = 0,
192 196
          stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
@@ -519,10 +523,6 @@ void idle(
519 523
     gcode.host_keepalive();
520 524
   #endif
521 525
 
522
-  #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
523
-    thermalManager.auto_report_temperatures();
524
-  #endif
525
-
526 526
   manage_inactivity(
527 527
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
528 528
       no_stepper_sleep
@@ -547,13 +547,20 @@ void idle(
547 547
     }
548 548
   #endif
549 549
 
550
-  #if ENABLED(AUTO_REPORT_SD_STATUS)
551
-    card.auto_report_sd_status();
552
-  #endif
553
-
554 550
   #ifdef HAL_IDLETASK
555 551
     HAL_idletask();
556 552
   #endif
553
+
554
+  #if HAS_AUTO_REPORTING
555
+    if (!suspend_auto_report) {
556
+      #if ENABLED(AUTO_REPORT_TEMPERATURES)
557
+        thermalManager.auto_report_temperatures();
558
+      #endif
559
+      #if ENABLED(AUTO_REPORT_SD_STATUS)
560
+        card.auto_report_sd_status();
561
+      #endif
562
+    }
563
+  #endif
557 564
 }
558 565
 
559 566
 /**

+ 4
- 0
Marlin/src/Marlin.h 查看文件

@@ -188,6 +188,10 @@ extern volatile bool wait_for_heatup;
188 188
   extern volatile bool wait_for_user;
189 189
 #endif
190 190
 
191
+#if HAS_AUTO_REPORTING
192
+  extern bool suspend_auto_report;
193
+#endif
194
+
191 195
 #if ENABLED(AUTO_BED_LEVELING_UBL)
192 196
   typedef struct { double A, B, D; } linear_fit;
193 197
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);

+ 2
- 0
Marlin/src/inc/Conditionals_post.h 查看文件

@@ -821,6 +821,8 @@
821 821
   #undef AUTO_REPORT_TEMPERATURES
822 822
 #endif
823 823
 
824
+#define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS))
825
+
824 826
 /**
825 827
  * This setting is also used by M109 when trying to calculate
826 828
  * a ballpark safe margin to prevent wait-forever situation.

Loading…
取消
儲存