Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2020-04-28 01:29:21 +0300
committerDavid Crocker <dcrocker@eschertech.com>2020-04-28 01:29:21 +0300
commit5dda6c9d5aaa24ea94f9246db73e702580e5d0dc (patch)
tree510394af8799f64fdc2432da772a6770add33b24 /src/Fans/LocalFan.cpp
parent9ead98ce7dc8a4fe1454a7003b14fee1aab51941 (diff)
Bug fixes, and restore correct heigt after a tool change
Thermostatically-controlled fans were no longer forced to run at >=50% PWM when on Proportional control of thermostatic fans no longer worked When restoring position after a pause or after skipping a build object, the inverse bed compensation applied when recomputing the user position did not take account of the tool offset After a tool change, if on a FDM printer then we now move the new tool to the correct Z height before resuming the print
Diffstat (limited to 'src/Fans/LocalFan.cpp')
-rw-r--r--src/Fans/LocalFan.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/Fans/LocalFan.cpp b/src/Fans/LocalFan.cpp
index 28388c07..5fb4b8d5 100644
--- a/src/Fans/LocalFan.cpp
+++ b/src/Fans/LocalFan.cpp
@@ -66,7 +66,6 @@ void LocalFan::SetHardwarePwm(float pwmVal) noexcept
// Refresh the fan PWM
// Checking all the sensors is expensive, so only do this if checkSensors is true.
-// If you want make sure that the PWM is definitely updated, set lastPWM negative before calling this
void LocalFan::InternalRefresh(bool checkSensors) noexcept
{
float reqVal;
@@ -80,7 +79,7 @@ void LocalFan::InternalRefresh(bool checkSensors) noexcept
}
else if (!checkSensors)
{
- reqVal = (lastVal == 0.0) ? 0.0 : val;
+ reqVal = lastVal;
}
else
{
@@ -144,28 +143,24 @@ void LocalFan::InternalRefresh(bool checkSensors) noexcept
blipStartTime = millis();
}
}
-
- if (blipping)
+ else if (blipping && millis() - blipStartTime >= blipTime)
{
- if (millis() - blipStartTime < blipTime)
- {
- reqVal = 1.0;
- }
- else
- {
- blipping = false;
- }
+ blipping = false;
}
}
-#if HAS_SMART_DRIVERS
- else if (driverChannelsMonitored.IsNonEmpty() && lastVal != 0.0)
+ else
{
- reprap.GetPlatform().DriverCoolingFansOnOff(driverChannelsMonitored, false); // tell Platform that we have stopped a fan that cools drivers
- }
+ blipping = false;
+#if HAS_SMART_DRIVERS
+ if (driverChannelsMonitored.IsNonEmpty() && lastVal != 0.0)
+ {
+ reprap.GetPlatform().DriverCoolingFansOnOff(driverChannelsMonitored, false); // tell Platform that we have stopped a fan that cools drivers
+ }
#endif
+ }
- SetHardwarePwm(reqVal);
lastVal = reqVal;
+ SetHardwarePwm((blipping) ? 1.0 : reqVal);
}
GCodeResult LocalFan::Refresh(const StringRef& reply) noexcept