Skip to content

Commit

Permalink
Added HEATERS_PARALLEL (Request from reifsnyderb)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ErikZalm committed Nov 17, 2013
1 parent 48a185d commit 69af392
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define PS_ON_ASLEEP LOW
#endif

// Control heater 0 and heater 1 in parallel.
#define HEATERS_PARALLEL

//===========================================================================
//=============================Buffers ============================
//===========================================================================
Expand Down Expand Up @@ -418,6 +421,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
#endif

#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
#error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
#endif

#if TEMP_SENSOR_0 > 0
#define THERMISTORHEATER_0 TEMP_SENSOR_0
#define HEATER_0_USES_THERMISTOR
Expand Down
16 changes: 13 additions & 3 deletions Marlin/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ ISR(TIMER0_COMPB_vect)
static unsigned char temp_state = 0;
static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
static unsigned char soft_pwm_0;
#if EXTRUDERS > 1
#if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
static unsigned char soft_pwm_1;
#endif
#if EXTRUDERS > 2
Expand All @@ -1052,7 +1052,12 @@ ISR(TIMER0_COMPB_vect)

if(pwm_count == 0){
soft_pwm_0 = soft_pwm[0];
if(soft_pwm_0 > 0) WRITE(HEATER_0_PIN,1);
if(soft_pwm_0 > 0) {
WRITE(HEATER_0_PIN,1);
#ifdef HEATERS_PARALLEL
WRITE(HEATER_1_PIN,1);
#endif
}
#if EXTRUDERS > 1
soft_pwm_1 = soft_pwm[1];
if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1);
Expand All @@ -1070,7 +1075,12 @@ ISR(TIMER0_COMPB_vect)
if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
#endif
}
if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
if(soft_pwm_0 <= pwm_count) {
WRITE(HEATER_0_PIN,0);
#ifdef HEATERS_PARALLEL
WRITE(HEATER_1_PIN,0);
#endif
}
#if EXTRUDERS > 1
if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0);
#endif
Expand Down

0 comments on commit 69af392

Please sign in to comment.