stm32/rtc: Add auto-LSE-bypass detection with fallback to LSE then LSI.
If MICROPY_HW_RTC_USE_BYPASS is enabled the RTC startup goes as follows: - RTC is started with LSE in bypass mode to begin with - if that fails to start (after a given timeout) then LSE is reconfigured in non-bypass - if that fails to start then RTC is switched to LSI
This commit is contained in:
@@ -210,6 +210,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// If disabled then try normal (non-bypass) LSE first, with fallback to LSI.
|
||||
// If enabled first try LSE in bypass mode. If that fails to start, try non-bypass mode, with fallback to LSI.
|
||||
#ifndef MICROPY_HW_RTC_USE_BYPASS
|
||||
#define MICROPY_HW_RTC_USE_BYPASS (0)
|
||||
#endif
|
||||
|
||||
#if MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
|
||||
// Provide block device macros if internal flash storage is enabled
|
||||
#define MICROPY_HW_BDEV_IOCTL flash_bdev_ioctl
|
||||
|
||||
Reference in New Issue
Block a user