From 47988de521e2a1e4c8b50e3adc474abdd13f4cf8 Mon Sep 17 00:00:00 2001 From: Sissors Date: Tue, 9 Sep 2014 22:52:51 +0200 Subject: [PATCH] RTC works correctly Removes unnecesary code, and moved some things around, now it works fine. --- .../hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c index 0fd7be1a1b..9881b4b9e5 100644 --- a/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c +++ b/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/rtc_api.c @@ -23,17 +23,10 @@ #include "PeripheralPins.h" void rtc_init(void) { - if (PinMap_RTC[0].pin == NC) { - RTC_HAL_SetOscillatorCmd(RTC_BASE, true); - } SIM_HAL_EnableRtcClock(SIM_BASE, 0U); - RTC_HAL_SetSecsReg(RTC_BASE, 1); - RTC_HAL_Enable(RTC_BASE); - RTC_HAL_Init(RTC_BASE); - // select RTC clock source - SIM->SOPT1 &= ~SIM_SOPT1_OSC32KSEL_MASK; - SIM->SOPT1 |= SIM_SOPT1_OSC32KSEL(PinMap_RTC[0].peripheral); + RTC_HAL_Init(RTC_BASE); + RTC_HAL_Enable(RTC_BASE); RTC_HAL_EnableCounter(RTC_BASE, true); }