Browse Source

ExtUI: Fix fan wrapping around from 0 to 100 (#12987)

Marcio Teixeira 6 years ago
parent
commit
54fdf57b8c
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/lcd/extensible_ui/ui_api.cpp

+ 1
- 1
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

572
 
572
 
573
   void setTargetFan_percent(const float value, const fan_t fan) {
573
   void setTargetFan_percent(const float value, const fan_t fan) {
574
     if (fan < FAN_COUNT)
574
     if (fan < FAN_COUNT)
575
-      thermalManager.set_fan_speed(fan - FAN0, map(value, 0, 100, 0, 255));
575
+      thermalManager.set_fan_speed(fan - FAN0, map(clamp(value, 0, 100), 0, 100, 0, 255));
576
   }
576
   }
577
 
577
 
578
   void setFeedrate_percent(const float value) {
578
   void setFeedrate_percent(const float value) {

Loading…
Cancel
Save