From 896293d5bebfd6bded66439182df89c260580f3d Mon Sep 17 00:00:00 2001 From: bcostm Date: Wed, 26 Oct 2016 15:38:54 +0200 Subject: [PATCH] Replace TIM_MST_GET_PCLK_FREQ macro with TIM_MST_PCLK macro --- .../TARGET_DISCO_F051R8/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_F030R8/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_F031K6/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F042K6/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F070RB/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_F072RB/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F091RC/device/hal_tick.h | 4 +++- .../TARGET_BLUEPILL_F103C8/device/hal_tick.h | 4 ++-- .../TARGET_DISCO_F100RB/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_F103RB/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_F207ZG/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F303VC/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F334C8/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F302R8/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F303K8/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F303RE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F303ZE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F334R8/device/hal_tick.h | 4 +++- .../TARGET_B96B_F446VE/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F401VC/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F429ZI/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F469NI/device/hal_tick.h | 4 +++- .../TARGET_ELMO_F411RE/device/hal_tick.h | 4 +++- .../TARGET_STM32F4/TARGET_F429_F439/device/hal_tick.h | 4 +++- .../TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h | 4 +++- .../TARGET_MTS_MDOT_F405RG/device/hal_tick.h | 4 +++- .../TARGET_MTS_MDOT_F411RE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F401RE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F410RB/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F411RE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F446RE/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F446ZE/device/hal_tick.h | 4 +++- .../TARGET_STM32F407VG/device/hal_tick.h | 4 +++- .../TARGET_UBLOX_EVK_ODIN_W2/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F746NG/device/hal_tick.h | 4 +++- .../TARGET_DISCO_F769NI/device/hal_tick.h | 4 +++- .../TARGET_STM32F7/TARGET_F746_F756/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_F767ZI/device/hal_tick.h | 4 +++- .../TARGET_DISCO_L053C8/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_L011K4/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_L031K6/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_L053R8/device/hal_tick.h | 4 ++-- .../TARGET_NUCLEO_L073RZ/device/hal_tick.h | 4 ++-- .../TARGET_MOTE_L152RC/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_L152RE/device/hal_tick.h | 4 +++- .../TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h | 4 +++- .../TARGET_XDOT_L151CC/device/hal_tick.h | 4 +++- .../TARGET_DISCO_L476VG/device/hal_tick.h | 4 +++- .../TARGET_STM32L4/TARGET_L476_L486/device/hal_tick.h | 4 +++- .../TARGET_NUCLEO_L432KC/device/hal_tick.h | 4 +++- targets/TARGET_STM/stm_hal_tick_32b.c | 10 +++++++++- 51 files changed, 148 insertions(+), 62 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h index 62c5f7a9f2..7693bd3838 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h @@ -50,9 +50,9 @@ #define TIM_MST_RESET_ON __TIM1_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h index 62c5f7a9f2..7693bd3838 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h @@ -50,9 +50,9 @@ #define TIM_MST_RESET_ON __TIM1_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h index bb33f459ba..a4aebea92e 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h @@ -49,7 +49,9 @@ extern "C" { #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h index bb33f459ba..a4aebea92e 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h @@ -49,7 +49,9 @@ extern "C" { #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h index 62c5f7a9f2..7693bd3838 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h @@ -50,9 +50,9 @@ #define TIM_MST_RESET_ON __TIM1_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM1_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h index e6717a08f1..8ed05b5b47 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h index e6717a08f1..8ed05b5b47 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h index b8d9db81e0..608a14ff99 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM4_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM4_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h index b8d9db81e0..608a14ff99 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM4_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM4_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h index b8d9db81e0..608a14ff99 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM4_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM4_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h index aa7a8471b5..944dc4a4ca 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h @@ -49,7 +49,9 @@ extern "C" { #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F334C8/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F302R8/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303K8/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/device/hal_tick.h index 1cd0c1a18f..18d268d133 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F334R8/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/device/hal_tick.h index f34dc61483..570b5bc466 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/device/hal_tick.h index 030bf047c9..0054626537 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device/hal_tick.h index 1c38076507..9fd474a92b 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_F429_F439/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_F429_F439/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_F429_F439/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_F429_F439/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F410RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F410RB/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F410RB/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F410RB/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446RE/device/hal_tick.h index f34dc61483..570b5bc466 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446ZE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446ZE/device/hal_tick.h index f34dc61483..570b5bc466 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446ZE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446ZE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/device/hal_tick.h index 6c5ca9dfe1..48d72ed373 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/device/hal_tick.h index 030bf047c9..0054626537 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/device/hal_tick.h index 9a56751779..98096391dc 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F746NG/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/device/hal_tick.h index 9a56751779..98096391dc 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/device/hal_tick.h index 9a56751779..98096391dc 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_F746_F756/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/device/hal_tick.h index 9a56751779..98096391dc 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F767ZI/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device/hal_tick.h index cf61e3cc40..e02c692d5d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM21_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h index cf61e3cc40..e02c692d5d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM21_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h index cf61e3cc40..e02c692d5d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM21_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device/hal_tick.h index cf61e3cc40..e02c692d5d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM21_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h index cf61e3cc40..e02c692d5d 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h @@ -49,9 +49,9 @@ #define TIM_MST_RESET_ON __TIM21_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() -#define TIM_MST_16BIT 1 // A 16-bit timer is used +#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK2Freq() +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h index 2f836d4b6c..7e2887a173 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h index 2f836d4b6c..7e2887a173 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h index f60f5286fb..067ff1bd83 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h index f60f5286fb..067ff1bd83 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/device/hal_tick.h index 36396e84f9..c35bb39b87 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_L476_L486/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_L476_L486/device/hal_tick.h index 36396e84f9..c35bb39b87 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_L476_L486/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_L476_L486/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM5_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L432KC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L432KC/device/hal_tick.h index de0a585142..92fe7b9079 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L432KC/device/hal_tick.h +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L432KC/device/hal_tick.h @@ -49,7 +49,9 @@ #define TIM_MST_RESET_ON __TIM2_FORCE_RESET() #define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET() -#define TIM_MST_GET_PCLK_FREQ HAL_RCC_GetPCLK1Freq() +#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) #define HAL_TICK_DELAY (1000) // 1 ms diff --git a/targets/TARGET_STM/stm_hal_tick_32b.c b/targets/TARGET_STM/stm_hal_tick_32b.c index 5a1fb452ca..bb2eec16cf 100644 --- a/targets/TARGET_STM/stm_hal_tick_32b.c +++ b/targets/TARGET_STM/stm_hal_tick_32b.c @@ -75,7 +75,11 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { HAL_RCC_GetClockConfig(&RCC_ClkInitStruct, &PclkFreq); // Get timer clock value - PclkFreq = TIM_MST_GET_PCLK_FREQ; +#if TIM_MST_PCLK == 1 + PclkFreq = HAL_RCC_GetPCLK1Freq(); +#else + PclkFreq = HAL_RCC_GetPCLK2Freq(); +#endif // Enable timer clock TIM_MST_RCC; @@ -89,7 +93,11 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) { TimMasterHandle.Init.Period = 0xFFFFFFFF; // TIMxCLK = PCLKx when the APB prescaler = 1 else TIMxCLK = 2 * PCLKx +#if TIM_MST_PCLK == 1 if (RCC_ClkInitStruct.APB1CLKDivider == RCC_HCLK_DIV1) { +#else + if (RCC_ClkInitStruct.APB2CLKDivider == RCC_HCLK_DIV1) { +#endif TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 us tick } else {