mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 06:03:34 +08:00
Fix clock_time2ticks to round up, not down. This makes sem_timedwait for at least the necessary period.
This commit is contained in:
@@ -97,6 +97,6 @@ int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks)
|
||||
|
||||
/* Convert microseconds to clock ticks */
|
||||
|
||||
*ticks = relusec / USEC_PER_TICK;
|
||||
*ticks = (relusec + USEC_PER_TICK - 1) / USEC_PER_TICK;
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user