Skip to content

Commit a0fd0d3

Browse files
committed
STM32F4 - Rename RTC_LSI
1 parent faae463 commit a0fd0d3

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

hal/targets.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@
832832
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
833833
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
834834
"progen": {"target": "nucleo-f429zi"},
835-
"macros": ["DEVICE_RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
836-
"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"],
835+
"macros": ["RTC_LSI=1", "TRANSACTION_QUEUE_SIZE_SPI=2"],
836+
"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"],
837837
"detect_code": ["0796"],
838838
"features": ["IPV4"],
839839
"release_versions": ["2", "5"]
@@ -1072,7 +1072,7 @@
10721072
"core": "Cortex-M4F",
10731073
"default_toolchain": "ARM",
10741074
"extra_labels": ["STM", "STM32F4", "STM32F429", "STM32F429ZI", "STM32F429xx"],
1075-
"macros": ["DEVICE_RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
1075+
"macros": ["RTC_LSI=1","TRANSACTION_QUEUE_SIZE_SPI=2"],
10761076
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
10771077
"progen": {"target": "disco-f429zi"},
10781078
"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"],

hal/targets/hal/TARGET_STM/TARGET_STM32F4/rtc_api.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434

3535
#include "mbed_error.h"
3636

37-
#if DEVICE_RTC_LSI
37+
#if RTC_LSI
3838
static int rtc_inited = 0;
3939
#endif
4040

4141
static RTC_HandleTypeDef RtcHandle;
4242

43-
#if DEVICE_RTC_LSI
43+
#if RTC_LSI
4444
#define RTC_CLOCK LSI_VALUE
4545
#else
4646
#define RTC_CLOCK LSE_VALUE
@@ -63,14 +63,14 @@ void rtc_init(void)
6363
{
6464
RCC_OscInitTypeDef RCC_OscInitStruct;
6565

66-
#if DEVICE_RTC_LSI
66+
#if RTC_LSI
6767
if (rtc_inited) return;
6868
rtc_inited = 1;
6969
#endif
7070

7171
RtcHandle.Instance = RTC;
7272

73-
#if !DEVICE_RTC_LSI
73+
#if !RTC_LSI
7474
// Enable LSE Oscillator
7575
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
7676
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; /* Mandatory, otherwise the PLL is reconfigured! */
@@ -121,7 +121,7 @@ void rtc_init(void)
121121
}
122122

123123
#if DEVICE_LOWPOWERTIMER
124-
#if DEVICE_RTC_LSI
124+
#if RTC_LSI
125125
rtc_write(0);
126126
#else
127127
if (!rtc_isenabled()) {
@@ -137,7 +137,7 @@ void rtc_init(void)
137137

138138
void rtc_free(void)
139139
{
140-
#if DEVICE_RTC_LSI
140+
#if RTC_LSI
141141
// Enable Power clock
142142
__PWR_CLK_ENABLE();
143143

@@ -160,14 +160,14 @@ void rtc_free(void)
160160
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
161161
HAL_RCC_OscConfig(&RCC_OscInitStruct);
162162

163-
#if DEVICE_RTC_LSI
163+
#if RTC_LSI
164164
rtc_inited = 0;
165165
#endif
166166
}
167167

168168
int rtc_isenabled(void)
169169
{
170-
#if DEVICE_RTC_LSI
170+
#if RTC_LSI
171171
return rtc_inited;
172172
#else
173173
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return 1;

0 commit comments

Comments
 (0)