diff options
author | Damien George <damien.p.george@gmail.com> | 2019-04-11 12:14:21 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-04-11 12:14:21 +1000 |
commit | fc9f2ff0cdc3cc75732d7954ac012b5a25f20f10 (patch) | |
tree | d6a6fd86958a8e3c9ce7f45d11efcc734eccad64 | |
parent | 46e5d6b8893e07538c33677a349e9e2fd038e62c (diff) |
stm32/rtc: Remove unused LSE detection code.
-rw-r--r-- | ports/stm32/rtc.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/ports/stm32/rtc.c b/ports/stm32/rtc.c index ec1e947b2..8e56e25f9 100644 --- a/ports/stm32/rtc.c +++ b/ports/stm32/rtc.c @@ -73,36 +73,6 @@ STATIC bool rtc_use_lse = false; STATIC uint32_t rtc_startup_tick; STATIC bool rtc_need_init_finalise = false; -// check if LSE exists -// not well tested, should probably be removed -STATIC bool lse_magic(void) { -#if 0 - uint32_t mode_in = GPIOC->MODER & 0x3fffffff; - uint32_t mode_out = mode_in | 0x40000000; - GPIOC->MODER = mode_out; - GPIOC->OTYPER &= 0x7fff; - GPIOC->BSRRH = 0x8000; - GPIOC->OSPEEDR &= 0x3fffffff; - GPIOC->PUPDR &= 0x3fffffff; - int i = 0xff0; - __IO int d = 0; - uint32_t tc = 0; - __IO uint32_t j; - while (i) { - GPIOC->MODER = mode_out; - GPIOC->MODER = mode_in; - for (j = 0; j < d; j++) ; - i--; - if ((GPIOC->IDR & 0x8000) == 0) { - tc++; - } - } - return (tc < 0xff0)?true:false; -#else - return false; -#endif -} - void rtc_init_start(bool force_init) { RTCHandle.Instance = RTC; @@ -152,13 +122,6 @@ void rtc_init_start(bool force_init) { rtc_startup_tick = HAL_GetTick(); rtc_info = 0x3f000000 | (rtc_startup_tick & 0xffffff); - if (rtc_use_lse) { - if (lse_magic()) { - // don't even try LSE - rtc_use_lse = false; - rtc_info &= ~0x01000000; - } - } PYB_RTC_MspInit_Kick(&RTCHandle, rtc_use_lse, MICROPY_HW_RTC_USE_BYPASS); } |