Skip to content

Commit

Permalink
STM32F2 - Rename RTC_LSI
Browse files Browse the repository at this point in the history
  • Loading branch information
svastm committed Sep 29, 2016
1 parent a4db938 commit 574e7b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hal/targets/hal/TARGET_STM/TARGET_STM32F2/rtc_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include "mbed_error.h"

#if DEVICE_RTC_LSI
#if RTC_LSI
static int rtc_inited = 0;
#endif

Expand All @@ -44,13 +44,13 @@ void rtc_init(void)
RCC_OscInitTypeDef RCC_OscInitStruct;
uint32_t rtc_freq = 0;

#if DEVICE_RTC_LSI
#if RTC_LSI
rtc_inited = 1;
#endif

RtcHandle.Instance = RTC;

#if !DEVICE_RTC_LSI
#if !RTC_LSI
// Enable LSE Oscillator
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */
Expand Down Expand Up @@ -106,7 +106,7 @@ void rtc_init(void)

void rtc_free(void)
{
#if DEVICE_RTC_LSI
#if RTC_LSI
// Enable Power clock
__PWR_CLK_ENABLE();

Expand All @@ -128,14 +128,14 @@ void rtc_free(void)
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
HAL_RCC_OscConfig(&RCC_OscInitStruct);
#if DEVICE_RTC_LSI
#if RTC_LSI
rtc_inited = 0;
#endif
}

int rtc_isenabled(void)
{
#if DEVICE_RTC_LSI
#if RTC_LSI
return rtc_inited;
#else
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {
Expand Down

0 comments on commit 574e7b7

Please sign in to comment.