From fe5cf5b03e10bd33ae899339d5ebfef8e8d7f4f6 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Wed, 26 Feb 2025 15:40:58 +0800 Subject: [PATCH] nuttx/clock.h: add USEC2MSEC macro for microsecond to millisecond conversion Add USEC2MSEC macro to provide a convenient and consistent interface for converting microseconds to milliseconds, complementing the existing SEC, USEC, and NSEC conversion macros and improving code readability. Signed-off-by: Bowen Wang --- include/nuttx/clock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/nuttx/clock.h b/include/nuttx/clock.h index 6c176e6ef06..ec6a3a3a63e 100644 --- a/include/nuttx/clock.h +++ b/include/nuttx/clock.h @@ -217,6 +217,10 @@ #define MSEC2SEC(usec) div_const(msec, MSEC_PER_SEC) +/* USEC2MSEC */ + +#define USEC2MSEC(usec) div_const(usec, USEC_PER_MSEC) + /* USEC2SEC */ #define USEC2SEC(usec) div_const(usec, USEC_PER_SEC)