Browse Source

Add HAS_TEMP_HOTEND define

Scott Lahteine 8 years ago
parent
commit
d24f14a799
4 changed files with 10 additions and 8 deletions
  1. 2
    0
      Marlin/Conditionals.h
  2. 1
    1
      Marlin/Marlin.h
  3. 5
    5
      Marlin/Marlin_main.cpp
  4. 2
    2
      Marlin/temperature.cpp

+ 2
- 0
Marlin/Conditionals.h View File

581
 
581
 
582
   #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
582
   #define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
583
 
583
 
584
+  #define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
585
+
584
   /**
586
   /**
585
    * Helper Macros for heaters and extruder fan
587
    * Helper Macros for heaters and extruder fan
586
    */
588
    */

+ 1
- 1
Marlin/Marlin.h View File

368
   extern void digipot_i2c_init();
368
   extern void digipot_i2c_init();
369
 #endif
369
 #endif
370
 
370
 
371
-#if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
371
+#if HAS_TEMP_HOTEND || HAS_TEMP_BED
372
   void print_heaterstates();
372
   void print_heaterstates();
373
 #endif
373
 #endif
374
 
374
 

+ 5
- 5
Marlin/Marlin_main.cpp View File

4100
   if (print_job_stop()) LCD_MESSAGEPGM(WELCOME_MSG);
4100
   if (print_job_stop()) LCD_MESSAGEPGM(WELCOME_MSG);
4101
 }
4101
 }
4102
 
4102
 
4103
-#if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
4103
+#if HAS_TEMP_HOTEND || HAS_TEMP_BED
4104
 
4104
 
4105
   void print_heaterstates() {
4105
   void print_heaterstates() {
4106
-    #if HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)
4106
+    #if HAS_TEMP_HOTEND
4107
       SERIAL_PROTOCOLPGM(" T:");
4107
       SERIAL_PROTOCOLPGM(" T:");
4108
       SERIAL_PROTOCOL_F(degHotend(target_extruder), 1);
4108
       SERIAL_PROTOCOL_F(degHotend(target_extruder), 1);
4109
       SERIAL_PROTOCOLPGM(" /");
4109
       SERIAL_PROTOCOLPGM(" /");
4179
 inline void gcode_M105() {
4179
 inline void gcode_M105() {
4180
   if (setTargetedHotend(105)) return;
4180
   if (setTargetedHotend(105)) return;
4181
 
4181
 
4182
-  #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
4182
+  #if HAS_TEMP_HOTEND || HAS_TEMP_BED
4183
     SERIAL_PROTOCOLPGM(MSG_OK);
4183
     SERIAL_PROTOCOLPGM(MSG_OK);
4184
     print_heaterstates();
4184
     print_heaterstates();
4185
-  #else // !HAS_TEMP_0 && !HAS_TEMP_BED
4185
+  #else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
4186
     SERIAL_ERROR_START;
4186
     SERIAL_ERROR_START;
4187
     SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
4187
     SERIAL_ERRORLNPGM(MSG_ERR_NO_THERMISTORS);
4188
   #endif
4188
   #endif
4271
     now = millis();
4271
     now = millis();
4272
     if (now > next_temp_ms) { //Print temp & remaining time every 1s while waiting
4272
     if (now > next_temp_ms) { //Print temp & remaining time every 1s while waiting
4273
       next_temp_ms = now + 1000UL;
4273
       next_temp_ms = now + 1000UL;
4274
-      #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
4274
+      #if HAS_TEMP_HOTEND || HAS_TEMP_BED
4275
         print_heaterstates();
4275
         print_heaterstates();
4276
       #endif
4276
       #endif
4277
       #ifdef TEMP_RESIDENCY_TIME
4277
       #ifdef TEMP_RESIDENCY_TIME

+ 2
- 2
Marlin/temperature.cpp View File

350
     }
350
     }
351
     // Every 2 seconds...
351
     // Every 2 seconds...
352
     if (ms > temp_ms + 2000) {
352
     if (ms > temp_ms + 2000) {
353
-      #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
353
+      #if HAS_TEMP_HOTEND || HAS_TEMP_BED
354
         print_heaterstates();
354
         print_heaterstates();
355
         SERIAL_EOL;
355
         SERIAL_EOL;
356
       #endif
356
       #endif
1183
     WRITE_HEATER_ ## NR (LOW); \
1183
     WRITE_HEATER_ ## NR (LOW); \
1184
   }
1184
   }
1185
 
1185
 
1186
-  #if HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675)
1186
+  #if HAS_TEMP_HOTEND
1187
     setTargetHotend(0, 0);
1187
     setTargetHotend(0, 0);
1188
     soft_pwm[0] = 0;
1188
     soft_pwm[0] = 0;
1189
     WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0)
1189
     WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0)

Loading…
Cancel
Save