Skip to content

Commit c4e913b

Browse files
author
Cruz Monrreal
authored
Merge pull request #8960 from jeromecoutant/PR_RTC2
STM32: avoid STM32 family name check
2 parents 54f53e0 + 4aca14f commit c4e913b

File tree

12 files changed

+62
-69
lines changed

12 files changed

+62
-69
lines changed

targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32f0xx_hal_def.h"
46+
#include "stm32f0xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32F0xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
/* Includes ------------------------------------------------------------------*/
4747
#include "stm32f2xx_hal_def.h"
48+
#include "stm32f2xx_ll_rtc.h"
4849

4950
/** @addtogroup STM32F2xx_HAL_Driver
5051
* @{

targets/TARGET_STM/TARGET_STM32F3/device/stm32f3xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32f3xx_hal_def.h"
46+
#include "stm32f3xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32F3xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32f4xx_hal_def.h"
46+
#include "stm32f4xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32F4xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32f7xx_hal_def.h"
46+
#include "stm32f7xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32F7xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32l0xx_hal_def.h"
46+
#include "stm32l0xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32L0xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32L1/device/stm32l1xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32l1xx_hal_def.h"
46+
#include "stm32l1xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32L1xx_HAL_Driver
4849
* @{

targets/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_rtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
/* Includes ------------------------------------------------------------------*/
4545
#include "stm32l4xx_hal_def.h"
46+
#include "stm32l4xx_ll_rtc.h"
4647

4748
/** @addtogroup STM32L4xx_HAL_Driver
4849
* @{

targets/TARGET_STM/lp_ticker.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ void lp_ticker_init(void)
139139
LptimHandle.Init.OutputPolarity = LPTIM_OUTPUTPOLARITY_HIGH;
140140
LptimHandle.Init.UpdateMode = LPTIM_UPDATE_IMMEDIATE;
141141
LptimHandle.Init.CounterSource = LPTIM_COUNTERSOURCE_INTERNAL;
142-
#if (TARGET_STM32L4)
142+
#if defined (LPTIM_INPUT1SOURCE_GPIO) /* STM32L4 */
143143
LptimHandle.Init.Input1Source = LPTIM_INPUT1SOURCE_GPIO;
144144
LptimHandle.Init.Input2Source = LPTIM_INPUT2SOURCE_GPIO;
145-
#endif /* TARGET_STM32L4 */
145+
#endif /* LPTIM_INPUT1SOURCE_GPIO */
146146

147147
if (HAL_LPTIM_Init(&LptimHandle) != HAL_OK) {
148148
error("HAL_LPTIM_Init ERROR\n");
@@ -151,7 +151,7 @@ void lp_ticker_init(void)
151151

152152
NVIC_SetVector(LPTIM1_IRQn, (uint32_t)LPTIM1_IRQHandler);
153153

154-
#if !(TARGET_STM32L4)
154+
#if defined (__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT)
155155
/* EXTI lines are not configured by default */
156156
__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_IT();
157157
__HAL_LPTIM_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();
@@ -190,7 +190,8 @@ static void LPTIM1_IRQHandler(void)
190190
}
191191
}
192192

193-
#if !(TARGET_STM32L4)
193+
#if defined (__HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG)
194+
/* EXTI lines are not configured by default */
194195
__HAL_LPTIM_WAKEUPTIMER_EXTI_CLEAR_FLAG();
195196
#endif
196197
}

targets/TARGET_STM/mbed_overrides.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int mbed_sdk_inited = 0;
3232
// This function is called after RAM initialization and before main.
3333
void mbed_sdk_init()
3434
{
35-
#if TARGET_STM32F7
35+
#if defined(__ICACHE_PRESENT) /* STM32F7 */
3636
// The mbed_sdk_init can be called either during cold boot or during
3737
// application boot after bootloader has been executed.
3838
// In case the bootloader has already enabled the cache,
@@ -43,7 +43,7 @@ void mbed_sdk_init()
4343
if ((SCB->CCR & (uint32_t)SCB_CCR_DC_Msk) == 0) { // If DCache is disabled
4444
SCB_EnableDCache();
4545
}
46-
#endif /* TARGET_STM32F7 */
46+
#endif /* __ICACHE_PRESENT */
4747

4848
// Update the SystemCoreClock variable.
4949
SystemCoreClockUpdate();

0 commit comments

Comments
 (0)