diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 589ac0a27..4e1d8691e 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -686,6 +686,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)) @@ -748,6 +749,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/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ebb0d2b52..c332b41c7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7706,7 +7706,7 @@ inline void gcode_M104() { inline void gcode_M105() { if (get_target_extruder_from_command(105)) return; - #if HAS_TEMP_HOTEND || HAS_TEMP_BED + #if HAS_TEMP_SENSOR SERIAL_PROTOCOLPGM(MSG_OK); thermalManager.print_heaterstates(); #else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED @@ -7717,7 +7717,7 @@ inline void gcode_M105() { SERIAL_EOL(); } -#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) +#if ENABLED(AUTO_REPORT_TEMPERATURES) /** * M155: Set temperature auto-report interval. M155 S @@ -11682,7 +11682,7 @@ void process_parsed_command() { case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok") - #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED) + #if ENABLED(AUTO_REPORT_TEMPERATURES) case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval #endif diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index e4dadceea..212f445f2 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -416,7 +416,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 @@ -2235,7 +2235,7 @@ void Temperature::isr() { SBI(TIMSK0, OCIE0B); //re-enable Temperature ISR } -#if HAS_TEMP_HOTEND || HAS_TEMP_BED +#if HAS_TEMP_SENSOR void print_heater_state(const float &c, const float &t, #if ENABLED(SHOW_TEMP_ADC_VALUES) @@ -2326,4 +2326,4 @@ void Temperature::isr() { #endif // AUTO_REPORT_TEMPERATURES -#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED +#endif // HAS_TEMP_SENSOR diff --git a/Marlin/temperature.h b/Marlin/temperature.h index 710c9c23f..deeedafaf 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -571,7 +571,7 @@ class Temperature { #endif // HEATER_IDLE_HANDLER - #if HAS_TEMP_HOTEND || HAS_TEMP_BED + #if HAS_TEMP_SENSOR static void print_heaterstates(); #if ENABLED(AUTO_REPORT_TEMPERATURES) static uint8_t auto_report_temp_interval;