diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 4e1d8691e7..84be141d7d 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -753,6 +753,8 @@ #undef AUTO_REPORT_TEMPERATURES #endif + #define HAS_AUTO_REPORTING (ENABLED(AUTO_REPORT_TEMPERATURES) || ENABLED(AUTO_REPORT_SD_STATUS)) + /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 70ed6342aa..0cce1ab8a9 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -232,6 +232,10 @@ extern volatile bool wait_for_heatup; extern volatile bool wait_for_user; #endif +#if HAS_AUTO_REPORTING + extern bool suspend_auto_report; +#endif + extern float current_position[XYZE], destination[XYZE]; /** diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c332b41c70..32289275b7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -510,6 +510,10 @@ volatile bool wait_for_heatup = true; volatile bool wait_for_user = false; #endif +#if HAS_AUTO_REPORTING + bool suspend_auto_report; // = false +#endif + const char axis_codes[XYZE] = { 'X', 'Y', 'Z', 'E' }; // Number of characters read in the current line of serial input @@ -13454,10 +13458,6 @@ void idle( host_keepalive(); - #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) - thermalManager.auto_report_temperatures(); - #endif - manage_inactivity( #if ENABLED(ADVANCED_PAUSE_FEATURE) no_stepper_sleep @@ -13482,8 +13482,15 @@ void idle( } #endif - #if ENABLED(AUTO_REPORT_SD_STATUS) - card.auto_report_sd_status(); + #if HAS_AUTO_REPORTING + if (!suspend_auto_report) { + #if ENABLED(AUTO_REPORT_TEMPERATURES) + thermalManager.auto_report_temperatures(); + #endif + #if ENABLED(AUTO_REPORT_SD_STATUS) + card.auto_report_sd_status(); + #endif + } #endif }