mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-08 14:34:06 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue