cpu/kinetis/rtt: clear subseconds when writing seconds

This commit is contained in:
Thomas Stilwell 2019-01-13 17:38:57 -08:00
parent a032070e82
commit 3ea75d1314

View File

@ -110,6 +110,8 @@ void rtt_set_counter(uint32_t counter)
{
/* Disable time counter before writing to the timestamp register */
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;
/* Enable when done */
bit_set32(&RTC->SR, RTC_SR_TCE_SHIFT);