Skip to content

Commit

Permalink
Fix OCR / PWM calculation (MarlinFirmware#18094)
Browse files Browse the repository at this point in the history
  • Loading branch information
g3gg0 authored and vgadreau committed May 29, 2020
1 parent 65660b1 commit 9b27c4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/fast_pwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255
else
top = *timer.ICRn; // top = ICRn

_SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top / v_size)); // Scale 8/16-bit v to top value
_SET_OCRnQ(timer.OCRnQ, timer.q, v * float(top) / float(v_size)); // Scale 8/16-bit v to top value
}
}

Expand Down

0 comments on commit 9b27c4a

Please sign in to comment.