Fixed RTC_PRER initialization

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15758 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
vrepetenko 2022-09-04 07:11:14 +00:00
parent 29093a6e94
commit b21dea2d72
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,10 @@ void st_lld_init(void) {
/* Activate free running Binary mode.*/
RTC->ICSR |= RTC_ICSR_BIN_0;
/* Set RTC prescaler.*/
/* Set RTC prescaler.
Setting PRER has to be done as two writes. Write Sync part first
then Sync + Async. */
RTC->PRER = STM32_ST_RTC_PRER_BITS & 0x7FFF;
RTC->PRER = STM32_ST_RTC_PRER_BITS;
/* Exit initialization mode.*/