diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 01e78d720..2be4fb46a 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 68e84a055..33cc43cbd 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -188,6 +188,7 @@ * M145 - Set heatup values for materials on the LCD. H B F for S (0=PLA, 1=ABS) * M149 - Set temperature units. (Requires TEMPERATURE_UNITS_SUPPORT) * M150 - Set BlinkM Color R U B. Values 0-255. (Requires BLINKM) + * M155 - Auto-report temperatures with interval of S. (Requires AUTO_REPORT_TEMPERATURES) * M163 - Set a single proportion for a mixing extruder. (Requires MIXING_EXTRUDER) * M164 - Save the mix as a virtual extruder. (Requires MIXING_EXTRUDER and MIXING_VIRTUAL_TOOLS) * 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() { SERIAL_EOL; } +#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + + static uint8_t auto_report_temp_interval; + static millis_t next_temp_report_ms; + + /** + * M155: Set temperature auto-report interval. M155 S + */ + inline void gcode_M155() { + if (code_seen('S')) { + auto_report_temp_interval = code_value_byte(); + NOMORE(auto_report_temp_interval, 60); + next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; + } + } + + inline void auto_report_temperatures() { + if (auto_report_temp_interval && ELAPSED(millis(), next_temp_report_ms)) { + next_temp_report_ms = millis() + 1000UL * auto_report_temp_interval; + print_heaterstates(); + } + } + +#endif // AUTO_REPORT_TEMPERATURES + #if FAN_COUNT > 0 /** @@ -7840,6 +7866,12 @@ void process_next_command() { KEEPALIVE_STATE(NOT_BUSY); return; // "ok" already printed + #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + case 155: // M155: Set temperature auto-report interval + gcode_M155(); + break; + #endif + case 109: // M109: Wait for hotend temperature to reach target gcode_M109(); break; @@ -9663,7 +9695,13 @@ void idle( #endif ) { lcd_update(); + host_keepalive(); + + #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + auto_report_temperatures(); + #endif + manage_inactivity( #if ENABLED(FILAMENT_CHANGE_FEATURE) no_stepper_sleep diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index 54e1353d8..f7e905a52 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index 38f3c3b56..23f9ddfaa 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index be17e7462..5b800b49e 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index fbb975f5c..fb2eab135 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index e8d949bf1..01ddd1082 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -843,4 +843,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index d163cc69a..16b87d259 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index d16a69ec9..2a6a15c3e 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index c6f36a368..30e90f70b 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index 113addaf5..68d67ce56 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -845,4 +845,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index be17e7462..5b800b49e 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 6295b09f6..172f6bda7 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -839,4 +839,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index ec36224ea..d32047493 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -839,4 +839,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index ec36224ea..d32047493 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -839,4 +839,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index beacff976..550269bfb 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -844,4 +844,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index d02650f58..7c61bfdc5 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -839,4 +839,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index 6453b238f..986c09cff 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 3b72bf06a..07a097fcb 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -837,4 +837,9 @@ */ //#define PINS_DEBUGGING +/** + * Auto-report temperatures with M155 S + */ +//#define AUTO_REPORT_TEMPERATURES + #endif // CONFIGURATION_ADV_H