Merge pull request #30 from T3P3/FanFix

Fan fix
This commit is contained in:
Tony 2014-04-14 20:56:27 +01:00
commit a0193d0197

View file

@ -972,11 +972,16 @@ inline float Platform::DMix(int8_t heater) const
return dMix[heater];
}
//Changed to be compatible with existing gcode norms
// M106 S0 = fully off M106 S255 = fully on
inline void Platform::CoolingFan(float speed)
{
//byte p = (byte)(255.0*fmin(1.0, fmax(0.0, speed))); //this reverts to 0= off, 1 = on if uncommented
byte p = (byte)speed;
p = 255 - p; //duet v0.6
if(coolingFanPin < 0)
return;
analogWrite(coolingFanPin, (uint8_t)(speed*255.0));
analogWriteNonDue(coolingFanPin, p);
}
//inline void Platform::SetHeatOn(int8_t ho)