mirror of
https://github.com/apache/nuttx.git
synced 2026-09-23 07:14:28 +08:00
usleep: use div_const to optimize the usleep
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -206,10 +206,22 @@
|
||||
#define TICK2HSEC(tick) div_const_roundnearest(tick, TICK_PER_HSEC)
|
||||
#define TICK2SEC(tick) div_const_roundnearest(tick, TICK_PER_SEC)
|
||||
|
||||
/* MSEC2SEC */
|
||||
|
||||
#define MSEC2SEC(usec) div_const(msec, MSEC_PER_SEC)
|
||||
|
||||
/* USEC2SEC */
|
||||
|
||||
#define USEC2SEC(usec) div_const(usec, USEC_PER_SEC)
|
||||
|
||||
/* NSEC2USEC */
|
||||
|
||||
#define NSEC2USEC(nsec) div_const(nsec, NSEC_PER_USEC)
|
||||
|
||||
/* NSEC2MSEC */
|
||||
|
||||
#define NSEC2MSEC(nsec) div_const(nsec, NSEC_PER_MSEC)
|
||||
|
||||
#if defined(CONFIG_DEBUG_SCHED) && defined(CONFIG_SYSTEM_TIME64) && \
|
||||
!defined(CONFIG_SCHED_TICKLESS)
|
||||
/* Initial system timer ticks value close to maximum 32-bit value, to test
|
||||
|
||||
Reference in New Issue
Block a user