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.
2.0.x
Erik van der Zalm 11 years ago
parent 48a185d004
commit 69af392554

@ -365,6 +365,9 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#define PS_ON_ASLEEP LOW #define PS_ON_ASLEEP LOW
#endif #endif
// Control heater 0 and heater 1 in parallel.
#define HEATERS_PARALLEL
//=========================================================================== //===========================================================================
//=============================Buffers ============================ //=============================Buffers ============================
//=========================================================================== //===========================================================================
@ -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" #error "You cannot use TEMP_SENSOR_1_AS_REDUNDANT if EXTRUDERS > 1"
#endif #endif
#if EXTRUDERS > 1 && defined HEATERS_PARALLEL
#error "You cannot use HEATERS_PARALLEL if EXTRUDERS > 1"
#endif
#if TEMP_SENSOR_0 > 0 #if TEMP_SENSOR_0 > 0
#define THERMISTORHEATER_0 TEMP_SENSOR_0 #define THERMISTORHEATER_0 TEMP_SENSOR_0
#define HEATER_0_USES_THERMISTOR #define HEATER_0_USES_THERMISTOR

@ -1040,7 +1040,7 @@ ISR(TIMER0_COMPB_vect)
static unsigned char temp_state = 0; static unsigned char temp_state = 0;
static unsigned char pwm_count = (1 << SOFT_PWM_SCALE); static unsigned char pwm_count = (1 << SOFT_PWM_SCALE);
static unsigned char soft_pwm_0; static unsigned char soft_pwm_0;
#if EXTRUDERS > 1 #if (EXTRUDERS > 1) || defined(HEATERS_PARALLEL)
static unsigned char soft_pwm_1; static unsigned char soft_pwm_1;
#endif #endif
#if EXTRUDERS > 2 #if EXTRUDERS > 2
@ -1052,7 +1052,12 @@ ISR(TIMER0_COMPB_vect)
if(pwm_count == 0){ if(pwm_count == 0){
soft_pwm_0 = soft_pwm[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 #if EXTRUDERS > 1
soft_pwm_1 = soft_pwm[1]; soft_pwm_1 = soft_pwm[1];
if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1); if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1);
@ -1070,7 +1075,12 @@ ISR(TIMER0_COMPB_vect)
if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); if(soft_pwm_fan > 0) WRITE(FAN_PIN,1);
#endif #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 EXTRUDERS > 1
if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0); if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0);
#endif #endif

Loading…
Cancel
Save