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)
56
56
rtcc_init .presc = rtccCntPresc_32768 ;
57
57
RTCC_Init (& rtcc_init );
58
58
RTCC_Enable (true);
59
+ RTCC -> RET [0 ].REG = 0 ;
59
60
}
60
61
61
62
void rtc_free (void )
@@ -71,20 +72,13 @@ int rtc_isenabled(void)
71
72
72
73
time_t rtc_read (void )
73
74
{
74
- return RTCC_CounterGet ();
75
+ return RTCC_CounterGet () + RTCC -> RET [ 0 ]. REG ;
75
76
}
76
77
77
78
void rtc_write (time_t t )
78
79
{
79
80
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 ();
88
82
core_util_critical_section_exit ();
89
83
}
90
84
You can’t perform that action at this time.
0 commit comments