Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikZalm committed Oct 14, 2012
1 parent bc27d80 commit 016800b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions Marlin/temperature.cpp
Expand Up @@ -400,15 +400,15 @@ void manage_heater()
#endif


#ifndef PIDTEMPBED
#ifndef PIDTEMPBED
if(millis() - previous_millis_bed_heater < BED_CHECK_INTERVAL)
return;
previous_millis_bed_heater = millis();
#endif
#endif //PIDTEMPBED

#if TEMP_BED_PIN > -1

#ifdef PIDTEMPBED
#ifdef PIDTEMPBED
pid_input = analog2tempBed(current_raw_bed);

#ifndef PID_OPENLOOP
Expand Down Expand Up @@ -437,37 +437,34 @@ void manage_heater()
soft_pwm_bed = 0;
}

#elif not defined BED_LIMIT_SWITCHING
#elif not defined BED_LIMIT_SWITCHING //PIDTEMPBED
// Check if temperature is within the correct range
if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
if(current_raw_bed >= target_raw_bed)
{
soft_pwm_bed = 0;
WRITE(HEATER_BED_PIN,LOW);
}
else
{
soft_pwm_bed = MAX_BED_POWER>>1;
WRITE(HEATER_BED_PIN,HIGH);
}
}
else {
soft_pwm_bed = 0;
WRITE(HEATER_BED_PIN,LOW);
}
#else //#ifdef BED_LIMIT_SWITCHING
// Check if temperature is within the correct band
if((current_raw_bed > bed_minttemp) && (current_raw_bed < bed_maxttemp)) {
if(current_raw_bed > target_bed_high_temp)
{
soft_pwm_bed = 0;
WRITE(HEATER_BED_PIN,LOW);
}
else
if(current_raw_bed <= target_bed_low_temp)
else if(current_raw_bed <= target_bed_low_temp)
{
soft_pwm_bed = MAX_BED_POWER>>1;
WRITE(HEATER_BED_PIN,HIGH);
}
}
else {
soft_pwm_bed = 0;
WRITE(HEATER_BED_PIN,LOW);
}
#endif
Expand Down Expand Up @@ -926,9 +923,11 @@ ISR(TIMER0_COMPB_vect)
if(soft_pwm_2 > 0) WRITE(HEATER_2_PIN,1);
#endif
#if HEATER_BED_PIN > -1
#ifdef PIDTEMPBED
soft_pwm_b = soft_pwm_bed;
if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1);
#endif
#endif
}
if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0);
#if EXTRUDERS > 1
Expand All @@ -938,8 +937,10 @@ ISR(TIMER0_COMPB_vect)
if(soft_pwm_2 <= pwm_count) WRITE(HEATER_2_PIN,0);
#endif
#if HEATER_BED_PIN > -1
#ifdef PIDTEMPBED
if(soft_pwm_b <= pwm_count) WRITE(HEATER_BED_PIN,0);
#endif
#endif

pwm_count++;
pwm_count &= 0x7f;
Expand Down

0 comments on commit 016800b

Please sign in to comment.