rtc/rpmsg: Add sync parameter to control whether call clock_synchronize
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6121f15d51
commit
41b9cf3cd8
@ -128,6 +128,6 @@ int up_rtc_initialize(void)
|
||||
#ifdef CONFIG_RTC_RPMSG_SERVER
|
||||
rtc = rpmsg_rtc_server_initialize(rtc);
|
||||
#endif
|
||||
up_rtc_set_lowerhalf(rtc);
|
||||
up_rtc_set_lowerhalf(rtc, true);
|
||||
return rtc_initialize(0, rtc);
|
||||
}
|
||||
|
@ -450,7 +450,7 @@ int sim_bringup(void)
|
||||
|
||||
#if defined(CONFIG_RTC_RPMSG) && !defined(CONFIG_RTC_RPMSG_SERVER)
|
||||
rtc = rpmsg_rtc_initialize();
|
||||
up_rtc_set_lowerhalf(rtc);
|
||||
up_rtc_set_lowerhalf(rtc, true);
|
||||
rtc_initialize(0, rtc);
|
||||
#endif
|
||||
|
||||
|
@ -50,13 +50,16 @@ volatile bool g_rtc_enabled = false;
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void up_rtc_set_lowerhalf(FAR struct rtc_lowerhalf_s *lower)
|
||||
void up_rtc_set_lowerhalf(FAR struct rtc_lowerhalf_s *lower, bool sync)
|
||||
{
|
||||
g_rtc_lower = lower;
|
||||
g_rtc_enabled = true;
|
||||
|
||||
#ifdef CONFIG_RTC_EXTERNAL
|
||||
clock_synchronize();
|
||||
if (sync)
|
||||
{
|
||||
clock_synchronize();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -42,11 +42,11 @@ extern "C"
|
||||
|
||||
#ifdef CONFIG_RTC_ARCH
|
||||
|
||||
void up_rtc_set_lowerhalf(FAR struct rtc_lowerhalf_s *lower);
|
||||
void up_rtc_set_lowerhalf(FAR struct rtc_lowerhalf_s *lower, bool sync);
|
||||
|
||||
#else
|
||||
|
||||
# define up_rtc_set_lowerhalf(lower)
|
||||
# define up_rtc_set_lowerhalf(lower, sync)
|
||||
|
||||
#endif /* CONFIG_RTC_ARCH */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user