From 1d646bcf56f6947643e8ed507875c648cdf3d195 Mon Sep 17 00:00:00 2001 From: Z8MAN8 <1468559561@qq.com> Date: Mon, 12 Aug 2024 09:52:12 +0800 Subject: [PATCH] Add RT_USING_RTC conditional compilation protection in ctimer.c Analysis: There is still an omission in the preprocessing control of _control_rtc in 24b0a81 ("Add RT_USING_RTC conditional compilation protection in ctimer.c") Solution: Add RT_USING_RTC preprocessing control to missing _control_rtc Signed-off-by: Shicheng Chu <1468559561@qq.com> --- components/libc/compilers/common/ctime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c index 480fe02a54..3eed76135f 100644 --- a/components/libc/compilers/common/ctime.c +++ b/components/libc/compilers/common/ctime.c @@ -1199,11 +1199,13 @@ int timer_settime(timer_t timerid, int flags, const struct itimerspec *value, switch (timer->clockid) { +#ifdef RT_USING_RTC case CLOCK_REALTIME: case CLOCK_REALTIME_ALARM: if (flags & TIMER_ABSTIME) err = _control_rtc(RT_DEVICE_CTRL_RTC_GET_TIMESPEC, &ts); break; +#endif /* RT_USING_RTC */ case CLOCK_MONOTONIC: case CLOCK_BOOTTIME: case CLOCK_BOOTTIME_ALARM: