mirror of https://github.com/ARMmbed/mbed-os.git
STM32F4 - Rename RTC_LSI
parent
faae46385f
commit
a0fd0d39c1
|
@ -832,8 +832,8 @@
|
|||
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
|
||||
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
|
||||
"progen": {"target": "nucleo-f429zi"},
|
||||
"macros": ["DEVICE_RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
|
||||
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "RTC_LSI", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
|
||||
"macros": ["RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
|
||||
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
|
||||
"detect_code": ["0796"],
|
||||
"features": ["IPV4"],
|
||||
"release_versions": ["2", "5"]
|
||||
|
@ -1072,7 +1072,7 @@
|
|||
"core": "Cortex-M4F",
|
||||
"default_toolchain": "ARM",
|
||||
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
|
||||
"macros": ["DEVICE_RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
|
||||
"macros": ["RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
|
||||
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
|
||||
"progen": {"target": "disco-f429zi"},
|
||||
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "ERROR_RED", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES", "TRNG"],
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
|
||||
#include "mbed_error.h"
|
||||
|
||||
#if DEVICE_RTC_LSI
|
||||
#if RTC_LSI
|
||||
static int rtc_inited = 0;
|
||||
#endif
|
||||
|
||||
static RTC_HandleTypeDef RtcHandle;
|
||||
|
||||
#if DEVICE_RTC_LSI
|
||||
#if RTC_LSI
|
||||
#define RTC_CLOCK LSI_VALUE
|
||||
#else
|
||||
#define RTC_CLOCK LSE_VALUE
|
||||
|
@ -63,14 +63,14 @@ void rtc_init(void)
|
|||
{
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
|
||||
#if DEVICE_RTC_LSI
|
||||
#if RTC_LSI
|
||||
if (rtc_inited) return;
|
||||
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! */
|
||||
|
@ -121,7 +121,7 @@ void rtc_init(void)
|
|||
}
|
||||
|
||||
#if DEVICE_LOWPOWERTIMER
|
||||
#if DEVICE_RTC_LSI
|
||||
#if RTC_LSI
|
||||
rtc_write(0);
|
||||
#else
|
||||
if (!rtc_isenabled()) {
|
||||
|
@ -137,7 +137,7 @@ void rtc_init(void)
|
|||
|
||||
void rtc_free(void)
|
||||
{
|
||||
#if DEVICE_RTC_LSI
|
||||
#if RTC_LSI
|
||||
// Enable Power clock
|
||||
__PWR_CLK_ENABLE();
|
||||
|
||||
|
@ -160,14 +160,14 @@ void rtc_free(void)
|
|||
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) return 1;
|
||||
|
|
Loading…
Reference in New Issue