Przeglądaj źródła

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>
Z8MAN8 8 miesięcy temu
rodzic
commit
1d646bcf56
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      components/libc/compilers/common/ctime.c

+ 2 - 0
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: