Browse Source

Fix OCR / PWM calculation (#18094)

Fixes #17968
g3gg0.de 5 years ago
parent
commit
f776260d7a
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/src/HAL/AVR/fast_pwm.cpp

+ 1
- 1
Marlin/src/HAL/AVR/fast_pwm.cpp View File

274
     else
274
     else
275
       top = *timer.ICRn; // top = ICRn
275
       top = *timer.ICRn; // top = ICRn
276
 
276
 
277
-    _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value
277
+    _SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
278
   }
278
   }
279
 }
279
 }
280
 
280
 

Loading…
Cancel
Save