summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorZ8MAN8 <[email protected]>2024-08-12 09:52:12 +0800
committerRbb666 <[email protected]>2024-08-12 15:56:17 +0800
commit1d646bcf56f6947643e8ed507875c648cdf3d195 (patch)
tree2c870d9437ce9e17f1d149bed6864274b1f20f2d /components
parentc468d1227cd8eba71582419e01e15385f2565b67 (diff)
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 <[email protected]>
Diffstat (limited to 'components')
-rw-r--r--components/libc/compilers/common/ctime.c2
1 files changed, 2 insertions, 0 deletions
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: