Skip to content

Commit 2cefe7d

Browse files
committed
[Nuvoton] Power down RTC access from CPU domain in rtc_free
After rtc_free, RTC gets inaccessible from CPU domain but keeps counting.
1 parent 5d8570b commit 2cefe7d

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

targets/TARGET_NUVOTON/TARGET_M451/rtc_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void rtc_init(void)
100100

101101
void rtc_free(void)
102102
{
103-
// N/A
103+
CLK_DisableModuleClock(rtc_modinit.clkidx);
104104
}
105105

106106
int rtc_isenabled(void)

targets/TARGET_NUVOTON/TARGET_M480/rtc_api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void rtc_init(void)
100100

101101
void rtc_free(void)
102102
{
103-
// N/A
103+
CLK_DisableModuleClock(rtc_modinit.clkidx);
104104
}
105105

106106
int rtc_isenabled(void)
@@ -114,6 +114,7 @@ int rtc_isenabled(void)
114114
// NOTE: Check RTC Init Active flag to support crossing reset cycle.
115115
return !! (RTC->INIT & RTC_INIT_ACTIVE_Msk);
116116
}
117+
117118
time_t rtc_read(void)
118119
{
119120
/* NOTE: After boot, RTC time registers are not synced immediately, about 1 sec latency.

targets/TARGET_NUVOTON/TARGET_NANO100/rtc_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void rtc_init(void)
100100

101101
void rtc_free(void)
102102
{
103-
// N/A
103+
CLK_DisableModuleClock(rtc_modinit.clkidx);
104104
}
105105

106106
int rtc_isenabled(void)

targets/TARGET_NUVOTON/TARGET_NUC472/rtc_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void rtc_init(void)
100100

101101
void rtc_free(void)
102102
{
103-
// N/A
103+
CLK_DisableModuleClock(rtc_modinit.clkidx);
104104
}
105105

106106
int rtc_isenabled(void)

0 commit comments

Comments
 (0)