Pārlūkot izejas kodu

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

Marcio Teixeira 5 gadus atpakaļ
vecāks
revīzija
54fdf57b8c
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1
    1
      Marlin/src/lcd/extensible_ui/ui_api.cpp

+ 1
- 1
Marlin/src/lcd/extensible_ui/ui_api.cpp Parādīt failu

@@ -572,7 +572,7 @@ namespace ExtUI {
572 572
 
573 573
   void setTargetFan_percent(const float value, const fan_t fan) {
574 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 578
   void setFeedrate_percent(const float value) {

Notiek ielāde…
Atcelt
Saglabāt