Browse Source

Added HEATERS_PARALLEL (Request from reifsnyderb)

This allows a hot end with two heaters and a FET for each heater. This is useful if the FET is not capable of heating two heaters.
Erik van der Zalm 11 years ago
parent
commit
69af392554
2 changed files with 20 additions and 3 deletions
  1. 7
    0
      Marlin/Configuration_adv.h
  2. 13
    3
      Marlin/temperature.cpp

+ 7
- 0
Marlin/Configuration_adv.h View File

365
   #define PS_ON_ASLEEP LOW
365
   #define PS_ON_ASLEEP LOW
366
 #endif
366
 #endif
367
 
367
 
368
+// Control heater 0 and heater 1 in parallel.
369
+#define HEATERS_PARALLEL
370
+
368
 //===========================================================================
371
 //===========================================================================
369
 //=============================Buffers           ============================
372
 //=============================Buffers           ============================
370
 //===========================================================================
373
 //===========================================================================
418
   #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
421
   #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
419
 #endif
422
 #endif
420
 
423
 
424
+#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
425
+  #error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
426
+#endif
427
+
421
 #if TEMP_SENSOR_0 > 0
428
 #if TEMP_SENSOR_0 > 0
422
   #define THERMISTORHEATER_0 TEMP_SENSOR_0
429
   #define THERMISTORHEATER_0 TEMP_SENSOR_0
423
   #define HEATER_0_USES_THERMISTOR
430
   #define HEATER_0_USES_THERMISTOR

+ 13
- 3
Marlin/temperature.cpp View File

1040
   static unsigned char temp_state = 0;
1040
   static unsigned char temp_state = 0;
1041
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1041
   static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
1042
   static unsigned char soft_pwm_0;
1042
   static unsigned char soft_pwm_0;
1043
-  #if EXTRUDERS > 1
1043
+  #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
1044
   static unsigned char soft_pwm_1;
1044
   static unsigned char soft_pwm_1;
1045
   #endif
1045
   #endif
1046
   #if EXTRUDERS > 2
1046
   #if EXTRUDERS > 2
1052
   
1052
   
1053
   if(pwm_count == 0){
1053
   if(pwm_count == 0){
1054
     soft_pwm_0 = soft_pwm[0];
1054
     soft_pwm_0 = soft_pwm[0];
1055
-    if(soft_pwm_0 > 0) WRITE(HEATER_0_PIN,1);
1055
+    if(soft_pwm_0 > 0) { 
1056
+      WRITE(HEATER_0_PIN,1);
1057
+      #ifdef HEATERS_PARALLEL
1058
+      WRITE(HEATER_1_PIN,1);
1059
+      #endif
1060
+    }
1056
     #if EXTRUDERS > 1
1061
     #if EXTRUDERS > 1
1057
     soft_pwm_1 = soft_pwm[1];
1062
     soft_pwm_1 = soft_pwm[1];
1058
     if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1);
1063
     if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1);
1070
     if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
1075
     if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
1071
     #endif
1076
     #endif
1072
   }
1077
   }
1073
-  if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
1078
+  if(soft_pwm_0 <= pwm_count) { 
1079
+      WRITE(HEATER_0_PIN,0);
1080
+      #ifdef HEATERS_PARALLEL
1081
+      WRITE(HEATER_1_PIN,0);
1082
+      #endif
1083
+    }
1074
   #if EXTRUDERS > 1
1084
   #if EXTRUDERS > 1
1075
   if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0);
1085
   if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0);
1076
   #endif
1086
   #endif

Loading…
Cancel
Save