MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / SetMappedFanSpeed

Method SetMappedFanSpeed

src/GCodes/GCodes.cpp:4119–4131  ·  view source on GitHub ↗

Set the speeds of fans mapped for the current tool to lastDefaultFanSpeed. gbp is nullptr when called from the Display subsystem.

Source from the content-addressed store, hash-verified

4117// Set the speeds of fans mapped for the current tool to lastDefaultFanSpeed.
4118// gbp is nullptr when called from the Display subsystem.
4119void GCodes::SetMappedFanSpeed(const GCodeBuffer *null gbp, float f) noexcept
4120{
4121 MovementState& ms = (gbp == nullptr) ? moveStates[0] : GetMovementState(*gbp);
4122 ms.virtualFanSpeed = f;
4123 if (ms.currentTool == nullptr)
4124 {
4125 reprap.GetFansManager().SetFanValue(0, f);
4126 }
4127 else
4128 {
4129 ms.currentTool->SetFansPwm(f);
4130 }
4131}
4132
4133// Handle sending a reply back to the appropriate interface(s) and update lastResult
4134// Note that 'reply' may be empty. If it isn't, then we need to append newline when sending it.

Callers 1

Adjust_SelectHelperMethod · 0.80

Calls 2

SetFanValueMethod · 0.80
SetFansPwmMethod · 0.80

Tested by

no test coverage detected