diff options
author | Damien George <damien.p.george@gmail.com> | 2019-04-11 12:09:21 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-04-11 12:09:21 +1000 |
commit | 46e5d6b8893e07538c33677a349e9e2fd038e62c (patch) | |
tree | 3c7e4981e20f5ad56cbc3cd022ab5b3e002ef00b /ports/stm32/mpconfigboard_common.h | |
parent | d5f0c87bb985ae344014dc2041fbaad5c522f638 (diff) | |
download | micropython-46e5d6b8893e07538c33677a349e9e2fd038e62c.tar.gz micropython-46e5d6b8893e07538c33677a349e9e2fd038e62c.zip |
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
Diffstat (limited to 'ports/stm32/mpconfigboard_common.h')
-rw-r--r-- | ports/stm32/mpconfigboard_common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ports/stm32/mpconfigboard_common.h b/ports/stm32/mpconfigboard_common.h index 1ace8fcaf4..08c835a1c2 100644 --- a/ports/stm32/mpconfigboard_common.h +++ b/ports/stm32/mpconfigboard_common.h @@ -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 |