mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-02-28 15:14:35 -07:00
stm32: fix static clock output for faster chips
Some checks are pending
Build test / build (push) Waiting to run
Some checks are pending
Build test / build (push) Waiting to run
If pcycle_time is scaled, the value should be scaled as well Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
parent
ae3eb30f28
commit
05ce956456
1 changed files with 2 additions and 0 deletions
|
|
@ -323,9 +323,11 @@ gpio_timer_setup(uint8_t pin, uint32_t cycle_time, uint32_t val,
|
|||
// CLK output
|
||||
if (is_clock_out) {
|
||||
prescaler = 1;
|
||||
val = val / pclock_div;
|
||||
while (pcycle_time > UINT16_MAX) {
|
||||
prescaler = prescaler * 2;
|
||||
pcycle_time /= 2;
|
||||
val /= 2;
|
||||
}
|
||||
max_pwm = pcycle_time;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue