diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index b8c025536585a66eaa599c99293a8a9da39dcc8d..89a4d47b10fe864135b12edc5ecdb628cd588f93 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -519,7 +519,7 @@ void idle( gcode.host_keepalive(); #endif - #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR thermalManager.auto_report_temperatures(); #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 45f7dc610808c1dad5aab31874008843d6346469..938488996ea43a01554cdb21b3ac551d696395e8 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -391,7 +391,7 @@ void GcodeSuite::process_parsed_command() { KEEPALIVE_STATE(NOT_BUSY); return; // "ok" already printed - #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR case 155: M155(); break; // M155: Set temperature auto-report interval #endif diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 296c0f3f47e5eb645f43d026e109649a0397a55b..bdef7dfca2348469c10a3fa8c3a44f667ac58e41 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -547,7 +547,7 @@ private: static void M150(); #endif - #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR static void M155(); #endif diff --git a/Marlin/src/gcode/temperature/M105.cpp b/Marlin/src/gcode/temperature/M105.cpp index 36d4d67ac5e208aa35b300f17769915bfa42c3f9..2c569e288858baf0c2bedf6398f733b55e1639db 100644 --- a/Marlin/src/gcode/temperature/M105.cpp +++ b/Marlin/src/gcode/temperature/M105.cpp @@ -37,7 +37,7 @@ void GcodeSuite::M105() { const int16_t port = command_queue_port[cmd_queue_index_r]; #endif - #if HAS_TEMP_HOTEND || HAS_TEMP_BED + #if HAS_TEMP_SENSOR SERIAL_PROTOCOLPGM_P(port, MSG_OK); thermalManager.print_heaterstates( #if NUM_SERIAL > 1 diff --git a/Marlin/src/gcode/temperature/M155.cpp b/Marlin/src/gcode/temperature/M155.cpp index d97e7b9ae9bce9fbc94044266f78e82177936bac..611676a6729f98b7be3e4168e85830b4b56b69e8 100644 --- a/Marlin/src/gcode/temperature/M155.cpp +++ b/Marlin/src/gcode/temperature/M155.cpp @@ -22,7 +22,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) +#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR #include "../gcode.h" #include "../../module/temperature.h" @@ -37,4 +37,4 @@ void GcodeSuite::M155() { } -#endif // AUTO_REPORT_TEMPERATURES && (HAS_TEMP_HOTEND || HAS_TEMP_BED) +#endif // AUTO_REPORT_TEMPERATURES && HAS_TEMP_SENSOR diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 25a7d4086f8d6aed23fe330dda7450788d02fc09..084f525869a2b06266efdc19162806fab7627124 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -754,6 +754,7 @@ #define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2) #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)) #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2) +#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED) // Heaters #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0)) @@ -816,6 +817,10 @@ #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS)) #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E)) +#if !HAS_TEMP_SENSOR + #undef AUTO_REPORT_TEMPERATURES +#endif + /** * This setting is also used by M109 when trying to calculate * a ballpark safe margin to prevent wait-forever situation. diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index bdee6e6bb046f9af66f4d689cabf670d50c8b990..fdefeeff04f4a3c6e17821b76f24f46c3b696fa0 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -417,7 +417,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS], // Report heater states every 2 seconds if (ELAPSED(ms, next_temp_ms)) { - #if HAS_TEMP_HOTEND || HAS_TEMP_BED + #if HAS_TEMP_SENSOR print_heaterstates(); SERIAL_EOL(); #endif @@ -2144,7 +2144,7 @@ void Temperature::isr() { ENABLE_TEMPERATURE_INTERRUPT(); //re-enable Temperature ISR } -#if HAS_TEMP_HOTEND || HAS_TEMP_BED +#if HAS_TEMP_SENSOR #include "../gcode/gcode.h" @@ -2251,4 +2251,4 @@ void Temperature::isr() { #endif // AUTO_REPORT_TEMPERATURES -#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED +#endif // HAS_TEMP_SENSOR diff --git a/Marlin/src/module/temperature.h b/Marlin/src/module/temperature.h index 9709ddff81360e78aaaff11ab5511675839cac72..b92140c26ad1bcb1d2592665d15f719e5cf11aec 100644 --- a/Marlin/src/module/temperature.h +++ b/Marlin/src/module/temperature.h @@ -564,7 +564,7 @@ class Temperature { #endif // HEATER_IDLE_HANDLER - #if HAS_TEMP_HOTEND || HAS_TEMP_BED + #if HAS_TEMP_SENSOR static void print_heaterstates( #if NUM_SERIAL > 1 const int8_t port = -1