Browse Source

Fix OCR / PWM calculation (#18094)

Fixes #17968
vanilla_fb_2.0.x
g3gg0.de 5 years ago
committed by GitHub
parent
commit
f776260d7a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Marlin/src/HAL/AVR/fast_pwm.cpp

2
Marlin/src/HAL/AVR/fast_pwm.cpp

@ -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
}
}

Loading…
Cancel
Save