We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1ce3b1 commit 74ff822Copy full SHA for 74ff822
teensy4/startup.c
@@ -231,10 +231,11 @@ static void ResetHandler2(void)
231
PIT_TCTRL3 = 0;
232
233
// initialize RTC
234
+ const uint32_t default_time = 1546300800; // Jan 1, 2019 UTC
235
if (!(SNVS_LPCR & SNVS_LPCR_SRTC_ENV)) {
- // if SRTC isn't running, start it with default Jan 1, 2019
236
- SNVS_LPSRTCLR = 1546300800u << 15;
237
- SNVS_LPSRTCMR = 1546300800u >> 17;
+ // if SRTC isn't running, start it with the default time
+ SNVS_LPSRTCLR = default_time << 15;
238
+ SNVS_LPSRTCMR = default_time >> 17;
239
SNVS_LPCR |= SNVS_LPCR_SRTC_ENV;
240
}
241
SNVS_HPCR |= SNVS_HPCR_RTC_EN | SNVS_HPCR_HP_TS;
0 commit comments