fix RTC with HSE initialisation
This commit is contained in:
parent
4dbf6df59f
commit
4b531542dc
|
@ -277,7 +277,7 @@ void main(void)
|
||||||
printf("setup internal RTC: ");
|
printf("setup internal RTC: ");
|
||||||
#if defined(BLUE_PILL) // for boards without a Low Speed External oscillator
|
#if defined(BLUE_PILL) // for boards without a Low Speed External oscillator
|
||||||
// /!\ WARNING the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
// /!\ WARNING the blue pill LSE oscillator is affected when toggling the onboard LED, thus prefer the HSE
|
||||||
rtc_auto_awake(RCC_LSE, 8000000 / 128 - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
rtc_auto_awake(RCC_HSE, 8000000 / 128 - 1); // use High Speed External oscillator (8 MHz / 128) as RTC clock (VBAT can't be used to keep the RTC running)
|
||||||
#else // for boards with an precise Low Speed External oscillator
|
#else // for boards with an precise Low Speed External oscillator
|
||||||
rtc_auto_awake(RCC_LSE, 32768 - 1); // ensure internal RTC is on, uses the 32.678 kHz LSE, and the prescale is set to our tick speed, else update backup registers accordingly (power off the micro-controller for the change to take effect)
|
rtc_auto_awake(RCC_LSE, 32768 - 1); // ensure internal RTC is on, uses the 32.678 kHz LSE, and the prescale is set to our tick speed, else update backup registers accordingly (power off the micro-controller for the change to take effect)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue