mirror of
https://github.com/andreili/klipper.git
synced 2025-08-23 19:34:06 +02:00
neopixel: Round up in nsecs_to_ticks()
The rp2040 operates at a fast internal clock with a relatively slow external timer and dividing down could result in a too small delay. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
cf3bedfbdc
commit
5b2f8104c7
@ -34,7 +34,7 @@ typedef unsigned int neopixel_time_t;
|
||||
static __always_inline neopixel_time_t
|
||||
nsecs_to_ticks(uint32_t ns)
|
||||
{
|
||||
return timer_from_us(ns * 1000) / 1000000;
|
||||
return DIV_ROUND_UP(timer_from_us(ns * 1000), 1000000);
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
Loading…
x
Reference in New Issue
Block a user