]> git.earman.xyz Git - sensor-watch.git/commit
Merge PR #450 - sync after enabling RTC
authorMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Fri, 30 Aug 2024 19:20:41 +0000 (16:20 -0300)
committerMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Fri, 30 Aug 2024 19:47:47 +0000 (16:47 -0300)
commitfa0cdef45bf1f4e629c87006a00fb8772f6cae04
tree3a736ef772f833c61c760bdb469aac69414597e0
parent879c48ce4d56315ad254bab937e7ddc046db998b
parentcae5d8a33f5e7aa248b07e7a1b59fbc60b8c5a3b
Merge PR #450 - sync after enabling RTC

According to the data sheet, writing to a Control A register's ENABLE
bit will trigger write synchronization and set SYNCBUSY's ENABLE bit
which will be automatically cleared by the hardware once the write
operation is complete.

It is necessary to wait until SYNCBUSY's ENABLE bit is clear.
Reading synchronized registers before that returns previous values.
Writing synchronized registers before that drops the write and generates
an error value in another register.

The data sheet recommends polling the ENABLE bit in this situation.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/450
References: SAM L22 Family Data Sheet ยงยง 14.3.2, 14.3.3, 14.3.4, 14.3.5