Parcourir la source

Add HAS_TEMP_SENSOR conditional

Scott Lahteine il y a 6 ans
Parent
révision
ffbf63e6af

+ 1
- 1
Marlin/src/Marlin.cpp Voir le fichier

@@ -519,7 +519,7 @@ void idle(
519 519
     gcode.host_keepalive();
520 520
   #endif
521 521
 
522
-  #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
522
+  #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
523 523
     thermalManager.auto_report_temperatures();
524 524
   #endif
525 525
 

+ 1
- 1
Marlin/src/gcode/gcode.cpp Voir le fichier

@@ -391,7 +391,7 @@ void GcodeSuite::process_parsed_command() {
391 391
         KEEPALIVE_STATE(NOT_BUSY);
392 392
         return; // "ok" already printed
393 393
 
394
-      #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
394
+      #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
395 395
         case 155: M155(); break;  // M155: Set temperature auto-report interval
396 396
       #endif
397 397
 

+ 1
- 1
Marlin/src/gcode/gcode.h Voir le fichier

@@ -547,7 +547,7 @@ private:
547 547
     static void M150();
548 548
   #endif
549 549
 
550
-  #if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
550
+  #if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
551 551
     static void M155();
552 552
   #endif
553 553
 

+ 1
- 1
Marlin/src/gcode/temperature/M105.cpp Voir le fichier

@@ -37,7 +37,7 @@ void GcodeSuite::M105() {
37 37
     const int16_t port = command_queue_port[cmd_queue_index_r];
38 38
   #endif
39 39
 
40
-  #if HAS_TEMP_HOTEND || HAS_TEMP_BED
40
+  #if HAS_TEMP_SENSOR
41 41
     SERIAL_PROTOCOLPGM_P(port, MSG_OK);
42 42
     thermalManager.print_heaterstates(
43 43
       #if NUM_SERIAL > 1

+ 2
- 2
Marlin/src/gcode/temperature/M155.cpp Voir le fichier

@@ -22,7 +22,7 @@
22 22
 
23 23
 #include "../../inc/MarlinConfig.h"
24 24
 
25
-#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
25
+#if ENABLED(AUTO_REPORT_TEMPERATURES) && HAS_TEMP_SENSOR
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../module/temperature.h"
@@ -37,4 +37,4 @@ void GcodeSuite::M155() {
37 37
 
38 38
 }
39 39
 
40
-#endif // AUTO_REPORT_TEMPERATURES && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
40
+#endif // AUTO_REPORT_TEMPERATURES && HAS_TEMP_SENSOR

+ 5
- 0
Marlin/src/inc/Conditionals_post.h Voir le fichier

@@ -754,6 +754,7 @@
754 754
 #define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
755 755
 #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
756 756
 #define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
757
+#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED)
757 758
 
758 759
 // Heaters
759 760
 #define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
@@ -816,6 +817,10 @@
816 817
 #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
817 818
 #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
818 819
 
820
+#if !HAS_TEMP_SENSOR
821
+  #undef AUTO_REPORT_TEMPERATURES
822
+#endif
823
+
819 824
 /**
820 825
  * This setting is also used by M109 when trying to calculate
821 826
  * a ballpark safe margin to prevent wait-forever situation.

+ 3
- 3
Marlin/src/module/temperature.cpp Voir le fichier

@@ -417,7 +417,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
417 417
 
418 418
       // Report heater states every 2 seconds
419 419
       if (ELAPSED(ms, next_temp_ms)) {
420
-        #if HAS_TEMP_HOTEND || HAS_TEMP_BED
420
+        #if HAS_TEMP_SENSOR
421 421
           print_heaterstates();
422 422
           SERIAL_EOL();
423 423
         #endif
@@ -2144,7 +2144,7 @@ void Temperature::isr() {
2144 2144
   ENABLE_TEMPERATURE_INTERRUPT(); //re-enable Temperature ISR
2145 2145
 }
2146 2146
 
2147
-#if HAS_TEMP_HOTEND || HAS_TEMP_BED
2147
+#if HAS_TEMP_SENSOR
2148 2148
 
2149 2149
   #include "../gcode/gcode.h"
2150 2150
 
@@ -2251,4 +2251,4 @@ void Temperature::isr() {
2251 2251
 
2252 2252
   #endif // AUTO_REPORT_TEMPERATURES
2253 2253
 
2254
-#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED
2254
+#endif // HAS_TEMP_SENSOR

+ 1
- 1
Marlin/src/module/temperature.h Voir le fichier

@@ -564,7 +564,7 @@ class Temperature {
564 564
 
565 565
     #endif // HEATER_IDLE_HANDLER
566 566
 
567
-    #if HAS_TEMP_HOTEND || HAS_TEMP_BED
567
+    #if HAS_TEMP_SENSOR
568 568
       static void print_heaterstates(
569 569
         #if NUM_SERIAL > 1
570 570
           const int8_t port = -1

Chargement…
Annuler
Enregistrer