From 54fdf57b8c7365ef13be3739ec7ff9218e26db5a Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Tue, 22 Jan 2019 22:33:11 -0700 Subject: [PATCH] ExtUI: Fix fan wrapping around from 0 to 100 (#12987) --- Marlin/src/lcd/extensible_ui/ui_api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/extensible_ui/ui_api.cpp b/Marlin/src/lcd/extensible_ui/ui_api.cpp index 417adf9e7..721e9f9b5 100644 --- a/Marlin/src/lcd/extensible_ui/ui_api.cpp +++ b/Marlin/src/lcd/extensible_ui/ui_api.cpp @@ -572,7 +572,7 @@ namespace ExtUI { void setTargetFan_percent(const float value, const fan_t fan) { if (fan < FAN_COUNT) - thermalManager.set_fan_speed(fan - FAN0, map(value, 0, 100, 0, 255)); + thermalManager.set_fan_speed(fan - FAN0, map(clamp(value, 0, 100), 0, 100, 0, 255)); } void setFeedrate_percent(const float value) {