diff options
Diffstat (limited to 'src/GCodes/GCodes.cpp')
-rw-r--r-- | src/GCodes/GCodes.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index e175175d..280b4831 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -3432,13 +3432,13 @@ GCodeResult GCodes::RetractFilament(GCodeBuffer& gb, bool retract) { // Set up the retract move const Tool * const tool = reprap.GetCurrentTool(); - if (tool != nullptr) + if (tool != nullptr && tool->DriveCount() != 0) { for (size_t i = 0; i < tool->DriveCount(); ++i) { moveBuffer.coords[ExtruderToLogicalDrive(tool->Drive(i))] = -retractLength; } - moveBuffer.feedRate = retractSpeed; + moveBuffer.feedRate = retractSpeed * tool->DriveCount(); moveBuffer.canPauseAfter = false; // don't pause after a retraction because that could cause too much retraction NewMoveAvailable(1); } @@ -3461,13 +3461,13 @@ GCodeResult GCodes::RetractFilament(GCodeBuffer& gb, bool retract) { // No retract hop, so just un-retract const Tool * const tool = reprap.GetCurrentTool(); - if (tool != nullptr) + if (tool != nullptr && tool->DriveCount() != 0) { for (size_t i = 0; i < tool->DriveCount(); ++i) { moveBuffer.coords[ExtruderToLogicalDrive(tool->Drive(i))] = retractLength + retractExtra; } - moveBuffer.feedRate = unRetractSpeed; + moveBuffer.feedRate = unRetractSpeed * tool->DriveCount(); moveBuffer.canPauseAfter = true; NewMoveAvailable(1); } @@ -4260,24 +4260,6 @@ void GCodes::GrabResource(const GCodeBuffer& gb, Resource r) } } -bool GCodes::LockHeater(const GCodeBuffer& gb, int heater) -{ - if (heater >= 0 && heater < (int)MaxHeaters) - { - return LockResource(gb, HeaterResourceBase + heater); - } - return true; -} - -bool GCodes::LockFan(const GCodeBuffer& gb, int fan) -{ - if (fan >= 0 && fan < (int)MaxFans) - { - return LockResource(gb, FanResourceBase + fan); - } - return true; -} - // Lock the unshareable parts of the file system bool GCodes::LockFileSystem(const GCodeBuffer &gb) { |