mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
sched/clock: Fix missing clock_inittime() call
The current implementation only calls clock_inittime() when RTC is enabled, which causes it to be skipped on other architectures. This patch ensures clock_inittime() is invoked during clock initialization for all cases. Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
committed by
Xiang Xiao
parent
37521ebf1d
commit
23733e7642
@@ -151,7 +151,6 @@ int clock_basetime(FAR struct timespec *tp)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_RTC
|
||||
static void clock_inittime(FAR const struct timespec *tp)
|
||||
{
|
||||
/* (Re-)initialize the time value to match the RTC */
|
||||
@@ -187,7 +186,6 @@ static void clock_inittime(FAR const struct timespec *tp)
|
||||
clock_inittimekeeping(tp);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -220,12 +218,13 @@ void clock_initialize(void)
|
||||
|
||||
up_rtc_initialize();
|
||||
|
||||
#if !defined(CONFIG_RTC_EXTERNAL)
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_RTC_EXTERNAL) || \
|
||||
!defined(CONFIG_RTC)
|
||||
/* Initialize the time value to match the RTC */
|
||||
|
||||
clock_inittime(NULL);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
perf_init();
|
||||
|
||||
Reference in New Issue
Block a user