STM32F2 - Rename RTC_LSI

pull/2816/head
svastm 2016-09-26 16:54:38 +02:00
parent a4db938b7a
commit 574e7b7622
1 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@
#include "mbed_error.h" #include "mbed_error.h"
#if DEVICE_RTC_LSI #if RTC_LSI
static int rtc_inited = 0; static int rtc_inited = 0;
#endif #endif
@ -44,13 +44,13 @@ void rtc_init(void)
RCC_OscInitTypeDef RCC_OscInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct;
uint32_t rtc_freq = 0; uint32_t rtc_freq = 0;
#if DEVICE_RTC_LSI #if RTC_LSI
rtc_inited = 1; rtc_inited = 1;
#endif #endif
RtcHandle.Instance = RTC; RtcHandle.Instance = RTC;
#if !DEVICE_RTC_LSI #if !RTC_LSI
// Enable LSE Oscillator // Enable LSE Oscillator
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */
@ -106,7 +106,7 @@ void rtc_init(void)
void rtc_free(void) void rtc_free(void)
{ {
#if DEVICE_RTC_LSI #if RTC_LSI
// Enable Power clock // Enable Power clock
__PWR_CLK_ENABLE(); __PWR_CLK_ENABLE();
@ -128,14 +128,14 @@ void rtc_free(void)
RCC_OscInitStruct.LSIState = RCC_LSI_OFF; RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
RCC_OscInitStruct.LSEState = RCC_LSE_OFF; RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
HAL_RCC_OscConfig(&RCC_OscInitStruct); HAL_RCC_OscConfig(&RCC_OscInitStruct);
#if DEVICE_RTC_LSI #if RTC_LSI
rtc_inited = 0; rtc_inited = 0;
#endif #endif
} }
int rtc_isenabled(void) int rtc_isenabled(void)
{ {
#if DEVICE_RTC_LSI #if RTC_LSI
return rtc_inited; return rtc_inited;
#else #else
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) { if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) {