瀏覽代碼

Add M155 - Auto-report temperature with interval

Scott Lahteine 8 年之前
父節點
當前提交
68b866b5dd

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

+ 38
- 0
Marlin/Marlin_main.cpp 查看文件

@@ -188,6 +188,7 @@
188 188
  * M145 - Set heatup values for materials on the LCD. H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
189 189
  * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT)
190 190
  * M150 - Set BlinkM Color R<red> U<green> B<blue>. Values 0-255. (Requires BLINKM)
191
+ * M155 - Auto-report temperatures with interval of S<seconds>. (Requires AUTO_REPORT_TEMPERATURES)
191 192
  * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER)
192 193
  * M164 - Save the mix as a virtual extruder. (Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS)
193 194
  * M165 - Set the proportions for a mixing extruder. Use parameters ABCDHI to set the mixing factors. (Requires MIXING_EXTRUDER)
@@ -5135,6 +5136,31 @@ inline void gcode_M105() {
5135 5136
   SERIAL_EOL;
5136 5137
 }
5137 5138
 
5139
+#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
5140
+
5141
+  static uint8_t auto_report_temp_interval;
5142
+  static millis_t next_temp_report_ms;
5143
+
5144
+  /**
5145
+   * M155: Set temperature auto-report interval. M155 S<seconds>
5146
+   */
5147
+  inline void gcode_M155() {
5148
+    if (code_seen('S')) {
5149
+      auto_report_temp_interval = code_value_byte();
5150
+      NOMORE(auto_report_temp_interval, 60);
5151
+      next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
5152
+    }
5153
+  }
5154
+
5155
+  inline void auto_report_temperatures() {
5156
+    if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) {
5157
+      next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval;
5158
+      print_heaterstates();
5159
+    }
5160
+  }
5161
+
5162
+#endif // AUTO_REPORT_TEMPERATURES
5163
+
5138 5164
 #if FAN_COUNT > 0
5139 5165
 
5140 5166
   /**
@@ -7840,6 +7866,12 @@ void process_next_command() {
7840 7866
         KEEPALIVE_STATE(NOT_BUSY);
7841 7867
         return; // "ok" already printed
7842 7868
 
7869
+      #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
7870
+        case 155: // M155: Set temperature auto-report interval
7871
+          gcode_M155();
7872
+          break;
7873
+      #endif
7874
+
7843 7875
       case 109: // M109: Wait for hotend temperature to reach target
7844 7876
         gcode_M109();
7845 7877
         break;
@@ -9663,7 +9695,13 @@ void idle(
9663 9695
   #endif
9664 9696
 ) {
9665 9697
   lcd_update();
9698
+
9666 9699
   host_keepalive();
9700
+
9701
+  #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
9702
+    auto_report_temperatures();
9703
+  #endif
9704
+
9667 9705
   manage_inactivity(
9668 9706
     #if ENABLED(FILAMENT_CHANGE_FEATURE)
9669 9707
       no_stepper_sleep

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -843,4 +843,9 @@
843 843
  */
844 844
 //#define PINS_DEBUGGING
845 845
 
846
+/**
847
+ * Auto-report temperatures with M155 S<seconds>
848
+ */
849
+//#define AUTO_REPORT_TEMPERATURES
850
+
846 851
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -845,4 +845,9 @@
845 845
  */
846 846
 //#define PINS_DEBUGGING
847 847
 
848
+/**
849
+ * Auto-report temperatures with M155 S<seconds>
850
+ */
851
+//#define AUTO_REPORT_TEMPERATURES
852
+
848 853
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -839,4 +839,9 @@
839 839
  */
840 840
 //#define PINS_DEBUGGING
841 841
 
842
+/**
843
+ * Auto-report temperatures with M155 S<seconds>
844
+ */
845
+//#define AUTO_REPORT_TEMPERATURES
846
+
842 847
 #endif // CONFIGURATION_ADV_H

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

@@ -839,4 +839,9 @@
839 839
  */
840 840
 //#define PINS_DEBUGGING
841 841
 
842
+/**
843
+ * Auto-report temperatures with M155 S<seconds>
844
+ */
845
+//#define AUTO_REPORT_TEMPERATURES
846
+
842 847
 #endif // CONFIGURATION_ADV_H

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

@@ -839,4 +839,9 @@
839 839
  */
840 840
 //#define PINS_DEBUGGING
841 841
 
842
+/**
843
+ * Auto-report temperatures with M155 S<seconds>
844
+ */
845
+//#define AUTO_REPORT_TEMPERATURES
846
+
842 847
 #endif // CONFIGURATION_ADV_H

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

@@ -844,4 +844,9 @@
844 844
  */
845 845
 //#define PINS_DEBUGGING
846 846
 
847
+/**
848
+ * Auto-report temperatures with M155 S<seconds>
849
+ */
850
+//#define AUTO_REPORT_TEMPERATURES
851
+
847 852
 #endif // CONFIGURATION_ADV_H

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

@@ -839,4 +839,9 @@
839 839
  */
840 840
 //#define PINS_DEBUGGING
841 841
 
842
+/**
843
+ * Auto-report temperatures with M155 S<seconds>
844
+ */
845
+//#define AUTO_REPORT_TEMPERATURES
846
+
842 847
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

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

@@ -837,4 +837,9 @@
837 837
  */
838 838
 //#define PINS_DEBUGGING
839 839
 
840
+/**
841
+ * Auto-report temperatures with M155 S<seconds>
842
+ */
843
+//#define AUTO_REPORT_TEMPERATURES
844
+
840 845
 #endif // CONFIGURATION_ADV_H

Loading…
取消
儲存