瀏覽代碼

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
   volatile bool wait_for_user = false;
187
   volatile bool wait_for_user = false;
188
 #endif
188
 #endif
189
 
189
 
190
+#if HAS_AUTO_REPORTING
191
+  bool suspend_auto_report; // = false
192
+#endif
193
+
190
 // Inactivity shutdown
194
 // Inactivity shutdown
191
 millis_t max_inactive_time = 0,
195
 millis_t max_inactive_time = 0,
192
          stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
196
          stepper_inactive_time = (DEFAULT_STEPPER_DEACTIVE_TIME) * 1000UL;
519
     gcode.host_keepalive();
523
     gcode.host_keepalive();
520
   #endif
524
   #endif
521
 
525
 
522
-  #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
523
-    thermalManager.auto_report_temperatures();
524
-  #endif
525
-
526
   manage_inactivity(
526
   manage_inactivity(
527
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
527
     #if ENABLED(ADVANCED_PAUSE_FEATURE)
528
       no_stepper_sleep
528
       no_stepper_sleep
547
     }
547
     }
548
   #endif
548
   #endif
549
 
549
 
550
-  #if ENABLED(AUTO_REPORT_SD_STATUS)
551
-    card.auto_report_sd_status();
552
-  #endif
553
-
554
   #ifdef HAL_IDLETASK
550
   #ifdef HAL_IDLETASK
555
     HAL_idletask();
551
     HAL_idletask();
556
   #endif
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
   extern volatile bool wait_for_user;
188
   extern volatile bool wait_for_user;
189
 #endif
189
 #endif
190
 
190
 
191
+#if HAS_AUTO_REPORTING
192
+  extern bool suspend_auto_report;
193
+#endif
194
+
191
 #if ENABLED(AUTO_BED_LEVELING_UBL)
195
 #if ENABLED(AUTO_BED_LEVELING_UBL)
192
   typedef struct { double A, B, D; } linear_fit;
196
   typedef struct { double A, B, D; } linear_fit;
193
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);
197
   linear_fit* lsf_linear_fit(double x[], double y[], double z[], const int);

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

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

Loading…
取消
儲存