Skip to content
Snippets Groups Projects
Unverified Commit 1f7292c3 authored by Peter Kietzmann's avatar Peter Kietzmann Committed by GitHub
Browse files

Merge pull request #10764 from benemorius/kinetis-rtt-subseconds

cpu/kinetis/rtt: clear TPR when writing TSR
parents 7e77ac7a 3ea75d13
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,8 @@ void rtt_set_counter(uint32_t counter) ...@@ -110,6 +110,8 @@ void rtt_set_counter(uint32_t counter)
{ {
/* Disable time counter before writing to the timestamp register */ /* Disable time counter before writing to the timestamp register */
bit_clear32(&RTC->SR, RTC_SR_TCE_SHIFT); bit_clear32(&RTC->SR, RTC_SR_TCE_SHIFT);
RTC->TPR = 0;
/* write TSR after TPR, as clearing TPR bit 14 will increment TSR */
RTC->TSR = counter; RTC->TSR = counter;
/* Enable when done */ /* Enable when done */
bit_set32(&RTC->SR, RTC_SR_TCE_SHIFT); bit_set32(&RTC->SR, RTC_SR_TCE_SHIFT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment