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
|
#ifdef CONFIG_RTC_RPMSG_SERVER
|
||||||
rtc = rpmsg_rtc_server_initialize(rtc);
|
rtc = rpmsg_rtc_server_initialize(rtc);
|
||||||
#endif
|
#endif
|
||||||
up_rtc_set_lowerhalf(rtc);
|
up_rtc_set_lowerhalf(rtc, true);
|
||||||
return rtc_initialize(0, rtc);
|
return rtc_initialize(0, rtc);
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ int sim_bringup(void)
|
|||||||
|
|
||||||
#if defined(CONFIG_RTC_RPMSG) && !defined(CONFIG_RTC_RPMSG_SERVER)
|
#if defined(CONFIG_RTC_RPMSG) && !defined(CONFIG_RTC_RPMSG_SERVER)
|
||||||
rtc = rpmsg_rtc_initialize();
|
rtc = rpmsg_rtc_initialize();
|
||||||
up_rtc_set_lowerhalf(rtc);
|
up_rtc_set_lowerhalf(rtc, true);
|
||||||
rtc_initialize(0, rtc);
|
rtc_initialize(0, rtc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -50,13 +50,16 @@ volatile bool g_rtc_enabled = false;
|
|||||||
* Public Functions
|
* 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_lower = lower;
|
||||||
g_rtc_enabled = true;
|
g_rtc_enabled = true;
|
||||||
|
|
||||||
#ifdef CONFIG_RTC_EXTERNAL
|
#ifdef CONFIG_RTC_EXTERNAL
|
||||||
|
if (sync)
|
||||||
|
{
|
||||||
clock_synchronize();
|
clock_synchronize();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,11 +42,11 @@ extern "C"
|
|||||||
|
|
||||||
#ifdef CONFIG_RTC_ARCH
|
#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
|
#else
|
||||||
|
|
||||||
# define up_rtc_set_lowerhalf(lower)
|
# define up_rtc_set_lowerhalf(lower, sync)
|
||||||
|
|
||||||
#endif /* CONFIG_RTC_ARCH */
|
#endif /* CONFIG_RTC_ARCH */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user