File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
targets/TARGET_Silicon_Labs/TARGET_EFM32 Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ void rtc_init(void)
5656 rtcc_init .presc = rtccCntPresc_32768 ;
5757 RTCC_Init (& rtcc_init );
5858 RTCC_Enable (true);
59+ RTCC -> RET [0 ].REG = 0 ;
5960}
6061
6162void rtc_free (void )
@@ -71,20 +72,13 @@ int rtc_isenabled(void)
7172
7273time_t rtc_read (void )
7374{
74- return RTCC_CounterGet ();
75+ return RTCC_CounterGet () + RTCC -> RET [ 0 ]. REG ;
7576}
7677
7778void rtc_write (time_t t )
7879{
7980 core_util_critical_section_enter ();
80- uint32_t diff = t - RTCC_CounterGet ();
81- lptick_offset += diff ;
82-
83- if (RTCC_IntGetEnabled () & RTCC_IF_CC0 ) {
84- RTCC -> CC [0 ].CCV += diff << 15 ;
85- }
86-
87- RTCC_CounterSet (t );
81+ RTCC -> RET [0 ].REG = t - RTCC_CounterGet ();
8882 core_util_critical_section_exit ();
8983}
9084
You can’t perform that action at this time.
0 commit comments