fixed pwm generation at pin D12 and D13 when one of them is used as FAN_PIN on Sanguino, added soft pwm entry for FAN_PIN in temperature.cpp

This commit is contained in:
oni303
2012-12-16 01:36:57 +01:00
parent 83ea7dc5b9
commit ab09fa4bbf
3 changed files with 22 additions and 0 deletions

View File

@ -460,10 +460,12 @@ void check_axes_activity()
else
{
#if FAN_PIN > -1
#ifndef FAN_SOFT_PWM
if (fanSpeed != 0){
analogWrite(FAN_PIN,fanSpeed); // If buffer is empty use current fan speed
}
#endif
#endif
}
if((DISABLE_X) && (x_active == 0)) disable_x();
if((DISABLE_Y) && (y_active == 0)) disable_y();
@ -475,6 +477,7 @@ void check_axes_activity()
disable_e2();
}
#if FAN_PIN > -1
#ifndef FAN_SOFT_PWM
if((fanSpeed == 0) && (fan_speed ==0))
{
analogWrite(FAN_PIN, 0);
@ -484,6 +487,7 @@ void check_axes_activity()
{
analogWrite(FAN_PIN,tail_fan_speed);
}
#endif
#endif
#ifdef AUTOTEMP
getHighESpeed();