From 9f757b44954e60db665aa41ed904d5e8e0073bd4 Mon Sep 17 00:00:00 2001 From: "Frederic.Pillon" Date: Fri, 17 May 2019 07:42:16 +0200 Subject: [PATCH] Review system Timer config Set TICK_INT_PRIORITY to 0 (Highest priority) by default, it can be redefined. Time base configuration function (HAL_InitTick ()) is called automatically at the beginning of the program after reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). The HAL_SYSTICK_Config()function calls the SysTick_Config() function which is a CMSIS function that: Configures the SysTick Reload register with value passed as function parameter. Configures the SysTick IRQ priority to the TICK_INT_PRIORITY. Resets the SysTick Counter register. Configures the SysTick Counter clock source to be Core Clock Source (HCLK). Enables the SysTick Interrupt. Starts the SysTick Counter. So, SystemClock_Config() (variant.cpp) does not need to be set explicitly. Signed-off-by: Frederic.Pillon --- system/STM32F0xx/stm32f0xx_hal_conf_default.h | 2 +- system/STM32F1xx/stm32f1xx_hal_conf_default.h | 2 +- system/STM32F2xx/stm32f2xx_hal_conf_default.h | 2 +- system/STM32F3xx/stm32f3xx_hal_conf_default.h | 2 +- system/STM32F4xx/stm32f4xx_hal_conf_default.h | 2 +- system/STM32F7xx/stm32f7xx_hal_conf_default.h | 2 +- system/STM32G0xx/stm32g0xx_hal_conf_default.h | 2 +- system/STM32H7xx/stm32h7xx_hal_conf_default.h | 2 +- system/STM32L0xx/stm32l0xx_hal_conf_default.h | 2 +- system/STM32L1xx/stm32l1xx_hal_conf_default.h | 2 +- system/STM32L4xx/stm32l4xx_hal_conf_default.h | 2 +- system/STM32WBxx/stm32wbxx_hal_conf_default.h | 2 +- variants/ARMED_V1/variant.cpp | 6 ------ variants/BLACK_F407XX/variant.cpp | 11 ----------- variants/BLACK_F407XX/variant.h | 3 --- variants/BLUEPILL_F103XX/variant.cpp | 9 --------- variants/BLUE_F407VE_Mini/variant.cpp | 11 ----------- variants/BLUE_F407VE_Mini/variant.h | 1 - variants/DEMO_F030F4/variant.cpp | 9 --------- variants/DISCO_F030R8/variant.cpp | 9 --------- variants/DISCO_F072RB/variant.cpp | 9 --------- variants/DISCO_F100RB/variant.cpp | 7 ------- variants/DISCO_F407VG/variant.cpp | 6 ------ variants/DISCO_F746NG/variant.cpp | 9 --------- variants/DISCO_L072CZ_LRWAN1/variant.cpp | 7 ------- variants/DISCO_L475VG_IOT/variant.cpp | 11 ----------- variants/DIYMROE_F407VGT/variant.cpp | 9 --------- variants/EEXTR_F030_V1/variant.cpp | 9 --------- variants/FK407M1/variant.cpp | 9 --------- variants/FK407M1/variant.h | 4 ---- variants/HY_TinySTM103T/variant.cpp | 9 --------- variants/MALYANM200_F070CB/variant.cpp | 9 --------- variants/MALYANM200_F103CB/variant.cpp | 7 ------- variants/MAPLEMINI_F103CB/variant.cpp | 9 --------- variants/NUCLEO_F030R8/variant.cpp | 7 ------- variants/NUCLEO_F091RC/variant.cpp | 7 ------- variants/NUCLEO_F103RB/variant.cpp | 9 --------- variants/NUCLEO_F207ZG/variant.cpp | 9 --------- variants/NUCLEO_F302R8/variant.cpp | 7 ------- variants/NUCLEO_F303K8/variant.cpp | 9 --------- variants/NUCLEO_F303RE/variant.cpp | 7 ------- variants/NUCLEO_F401RE/variant.cpp | 6 ------ variants/NUCLEO_F411RE/variant.cpp | 10 ---------- variants/NUCLEO_F429ZI/variant.cpp | 7 ------- variants/NUCLEO_F446RE/variant.cpp | 11 ----------- variants/NUCLEO_F767ZI/variant.cpp | 9 --------- variants/NUCLEO_G071RB/variant.cpp | 9 --------- variants/NUCLEO_H743ZI/variant.cpp | 9 --------- variants/NUCLEO_L031K6/variant.cpp | 9 --------- variants/NUCLEO_L053R8/variant.cpp | 7 ------- variants/NUCLEO_L073RZ/variant.cpp | 9 --------- variants/NUCLEO_L152RE/variant.cpp | 11 ----------- variants/NUCLEO_L452RE/variant.cpp | 9 --------- variants/NUCLEO_L496ZG/variant.cpp | 9 --------- variants/NUCLEO_L4R5ZI/variant.cpp | 11 ----------- variants/PNUCLEO_WB55RG/variant.cpp | 8 -------- variants/PRNTR_F407_V1/variant.cpp | 11 ----------- variants/RAK811_TRACKER/variant.cpp | 9 --------- variants/REMRAM_V1/variant.cpp | 9 --------- variants/REMRAM_V1/variant.h | 1 - variants/RUMBA32_F446VE/variant.cpp | 7 ------- variants/SPARKY_F303CC/variant.cpp | 12 ------------ 62 files changed, 12 insertions(+), 423 deletions(-) diff --git a/system/STM32F0xx/stm32f0xx_hal_conf_default.h b/system/STM32F0xx/stm32f0xx_hal_conf_default.h index c586c27233..0e95e7abed 100644 --- a/system/STM32F0xx/stm32f0xx_hal_conf_default.h +++ b/system/STM32F0xx/stm32f0xx_hal_conf_default.h @@ -167,7 +167,7 @@ in voltage and temperature. */ */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32F1xx/stm32f1xx_hal_conf_default.h b/system/STM32F1xx/stm32f1xx_hal_conf_default.h index 9b5208d062..001b44cfed 100644 --- a/system/STM32F1xx/stm32f1xx_hal_conf_default.h +++ b/system/STM32F1xx/stm32f1xx_hal_conf_default.h @@ -144,7 +144,7 @@ extern "C" { */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32F2xx/stm32f2xx_hal_conf_default.h b/system/STM32F2xx/stm32f2xx_hal_conf_default.h index e5b1c2e5cb..2a663d1c19 100644 --- a/system/STM32F2xx/stm32f2xx_hal_conf_default.h +++ b/system/STM32F2xx/stm32f2xx_hal_conf_default.h @@ -150,7 +150,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32F3xx/stm32f3xx_hal_conf_default.h b/system/STM32F3xx/stm32f3xx_hal_conf_default.h index 1a1b7ba106..1a0395d53a 100644 --- a/system/STM32F3xx/stm32f3xx_hal_conf_default.h +++ b/system/STM32F3xx/stm32f3xx_hal_conf_default.h @@ -167,7 +167,7 @@ in voltage and temperature. */ */ #define VDD_VALUE (3300U) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32F4xx/stm32f4xx_hal_conf_default.h b/system/STM32F4xx/stm32f4xx_hal_conf_default.h index e8f1ad6727..17d48e4855 100644 --- a/system/STM32F4xx/stm32f4xx_hal_conf_default.h +++ b/system/STM32F4xx/stm32f4xx_hal_conf_default.h @@ -148,7 +148,7 @@ in voltage and temperature. */ */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32F7xx/stm32f7xx_hal_conf_default.h b/system/STM32F7xx/stm32f7xx_hal_conf_default.h index 5950daa3d6..b8ba929e0f 100644 --- a/system/STM32F7xx/stm32f7xx_hal_conf_default.h +++ b/system/STM32F7xx/stm32f7xx_hal_conf_default.h @@ -148,7 +148,7 @@ in voltage and temperature. */ */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32G0xx/stm32g0xx_hal_conf_default.h b/system/STM32G0xx/stm32g0xx_hal_conf_default.h index 80f422f788..64a5995062 100644 --- a/system/STM32G0xx/stm32g0xx_hal_conf_default.h +++ b/system/STM32G0xx/stm32g0xx_hal_conf_default.h @@ -150,7 +150,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32H7xx/stm32h7xx_hal_conf_default.h b/system/STM32H7xx/stm32h7xx_hal_conf_default.h index 7da068916f..053114cbf4 100644 --- a/system/STM32H7xx/stm32h7xx_hal_conf_default.h +++ b/system/STM32H7xx/stm32h7xx_hal_conf_default.h @@ -161,7 +161,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY ((uint32_t)0x00) /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0 diff --git a/system/STM32L0xx/stm32l0xx_hal_conf_default.h b/system/STM32L0xx/stm32l0xx_hal_conf_default.h index c6cf5b3835..041a77891b 100644 --- a/system/STM32L0xx/stm32l0xx_hal_conf_default.h +++ b/system/STM32L0xx/stm32l0xx_hal_conf_default.h @@ -141,7 +141,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32L1xx/stm32l1xx_hal_conf_default.h b/system/STM32L1xx/stm32l1xx_hal_conf_default.h index 8ce2ae2923..fc7c208554 100644 --- a/system/STM32L1xx/stm32l1xx_hal_conf_default.h +++ b/system/STM32L1xx/stm32l1xx_hal_conf_default.h @@ -131,7 +131,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE (3300U) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY (0x000FU) /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY (0x0000U) /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32L4xx/stm32l4xx_hal_conf_default.h b/system/STM32L4xx/stm32l4xx_hal_conf_default.h index 012fde921d..c23013012d 100644 --- a/system/STM32L4xx/stm32l4xx_hal_conf_default.h +++ b/system/STM32L4xx/stm32l4xx_hal_conf_default.h @@ -179,7 +179,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE 3300U /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0U diff --git a/system/STM32WBxx/stm32wbxx_hal_conf_default.h b/system/STM32WBxx/stm32wbxx_hal_conf_default.h index f29d16b1fd..e61b333d0d 100644 --- a/system/STM32WBxx/stm32wbxx_hal_conf_default.h +++ b/system/STM32WBxx/stm32wbxx_hal_conf_default.h @@ -180,7 +180,7 @@ in voltage and temperature.*/ */ #define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ #if !defined (TICK_INT_PRIORITY) -#define TICK_INT_PRIORITY ((1UL<<__NVIC_PRIO_BITS) - 1UL) /*!< tick interrupt priority (lowest by default) */ +#define TICK_INT_PRIORITY 0x00U /*!< tick interrupt priority */ #endif #if !defined (USE_RTOS) #define USE_RTOS 0 diff --git a/variants/ARMED_V1/variant.cpp b/variants/ARMED_V1/variant.cpp index dde4cd7e43..a891073d6c 100644 --- a/variants/ARMED_V1/variant.cpp +++ b/variants/ARMED_V1/variant.cpp @@ -178,12 +178,6 @@ WEAK void SystemClock_Config(void) /* Enable the Flash prefetch */ __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); } - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/BLACK_F407XX/variant.cpp b/variants/BLACK_F407XX/variant.cpp index e78718c8a6..8094995148 100644 --- a/variants/BLACK_F407XX/variant.cpp +++ b/variants/BLACK_F407XX/variant.cpp @@ -222,17 +222,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/BLACK_F407XX/variant.h b/variants/BLACK_F407XX/variant.h index 1870f1e5e3..cf9e7bf0e9 100644 --- a/variants/BLACK_F407XX/variant.h +++ b/variants/BLACK_F407XX/variant.h @@ -316,9 +316,6 @@ extern "C" { #define PIN_SERIAL_RX PA10 #define PIN_SERIAL_TX PA9 -/* HAL configuration */ -#define TICK_INT_PRIORITY 0U - /* Extra HAL modules */ #define HAL_DAC_MODULE_ENABLED #define HAL_SD_MODULE_ENABLED diff --git a/variants/BLUEPILL_F103XX/variant.cpp b/variants/BLUEPILL_F103XX/variant.cpp index 85f408f9de..d38bcb5107 100644 --- a/variants/BLUEPILL_F103XX/variant.cpp +++ b/variants/BLUEPILL_F103XX/variant.cpp @@ -138,15 +138,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { while (1); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/BLUE_F407VE_Mini/variant.cpp b/variants/BLUE_F407VE_Mini/variant.cpp index fb7d41d36d..d84802f974 100644 --- a/variants/BLUE_F407VE_Mini/variant.cpp +++ b/variants/BLUE_F407VE_Mini/variant.cpp @@ -202,17 +202,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/BLUE_F407VE_Mini/variant.h b/variants/BLUE_F407VE_Mini/variant.h index 5b8ef88e86..d5d1fd31cf 100644 --- a/variants/BLUE_F407VE_Mini/variant.h +++ b/variants/BLUE_F407VE_Mini/variant.h @@ -193,7 +193,6 @@ extern "C" { /* HAL configuration */ #define HSE_VALUE 25000000U -#define TICK_INT_PRIORITY 0U /* Extra HAL modules */ #define HAL_DAC_MODULE_ENABLED diff --git a/variants/DEMO_F030F4/variant.cpp b/variants/DEMO_F030F4/variant.cpp index 18e81ddfb5..ccd60505df 100644 --- a/variants/DEMO_F030F4/variant.cpp +++ b/variants/DEMO_F030F4/variant.cpp @@ -110,15 +110,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_F030R8/variant.cpp b/variants/DISCO_F030R8/variant.cpp index 10eeac1cef..3877192962 100644 --- a/variants/DISCO_F030R8/variant.cpp +++ b/variants/DISCO_F030R8/variant.cpp @@ -164,15 +164,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_F072RB/variant.cpp b/variants/DISCO_F072RB/variant.cpp index 56bfe8daa5..0b5ec54da5 100644 --- a/variants/DISCO_F072RB/variant.cpp +++ b/variants/DISCO_F072RB/variant.cpp @@ -160,15 +160,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_F100RB/variant.cpp b/variants/DISCO_F100RB/variant.cpp index 00a3a153b9..a3aabef635 100644 --- a/variants/DISCO_F100RB/variant.cpp +++ b/variants/DISCO_F100RB/variant.cpp @@ -150,13 +150,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { while (1); } - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_F407VG/variant.cpp b/variants/DISCO_F407VG/variant.cpp index 1f4de0406a..6b2dea25b8 100644 --- a/variants/DISCO_F407VG/variant.cpp +++ b/variants/DISCO_F407VG/variant.cpp @@ -188,12 +188,6 @@ WEAK void SystemClock_Config(void) /* Enable the Flash prefetch */ __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); } - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_F746NG/variant.cpp b/variants/DISCO_F746NG/variant.cpp index 5160f9b1d7..2b7cccf4ec 100644 --- a/variants/DISCO_F746NG/variant.cpp +++ b/variants/DISCO_F746NG/variant.cpp @@ -138,15 +138,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_L072CZ_LRWAN1/variant.cpp b/variants/DISCO_L072CZ_LRWAN1/variant.cpp index 31918e1e50..fcf1fe6ac6 100644 --- a/variants/DISCO_L072CZ_LRWAN1/variant.cpp +++ b/variants/DISCO_L072CZ_LRWAN1/variant.cpp @@ -120,13 +120,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DISCO_L475VG_IOT/variant.cpp b/variants/DISCO_L475VG_IOT/variant.cpp index 59b85e6d60..eebd9235e1 100644 --- a/variants/DISCO_L475VG_IOT/variant.cpp +++ b/variants/DISCO_L475VG_IOT/variant.cpp @@ -229,20 +229,9 @@ WEAK void SystemClock_Config(void) Error_Handler(); } - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - /**Enable MSI Auto calibration */ HAL_RCCEx_EnableMSIPLLMode(); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/DIYMROE_F407VGT/variant.cpp b/variants/DIYMROE_F407VGT/variant.cpp index 22c868f8fb..8b57d5d505 100644 --- a/variants/DIYMROE_F407VGT/variant.cpp +++ b/variants/DIYMROE_F407VGT/variant.cpp @@ -203,15 +203,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/EEXTR_F030_V1/variant.cpp b/variants/EEXTR_F030_V1/variant.cpp index e09f3fd1f3..4c60143065 100644 --- a/variants/EEXTR_F030_V1/variant.cpp +++ b/variants/EEXTR_F030_V1/variant.cpp @@ -136,15 +136,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/FK407M1/variant.cpp b/variants/FK407M1/variant.cpp index 83f4dc3b19..cb3a9e9626 100644 --- a/variants/FK407M1/variant.cpp +++ b/variants/FK407M1/variant.cpp @@ -150,15 +150,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/FK407M1/variant.h b/variants/FK407M1/variant.h index 8bdfdd5d37..088155bbe2 100644 --- a/variants/FK407M1/variant.h +++ b/variants/FK407M1/variant.h @@ -165,10 +165,6 @@ extern "C" { #define PIN_SERIAL_RX PA10 #define PIN_SERIAL_TX PA9 - -/* HAL configuration */ -#define TICK_INT_PRIORITY 0U - /* Extra HAL modules */ #define HAL_DAC_MODULE_ENABLED diff --git a/variants/HY_TinySTM103T/variant.cpp b/variants/HY_TinySTM103T/variant.cpp index bd849d6833..dfab89929b 100644 --- a/variants/HY_TinySTM103T/variant.cpp +++ b/variants/HY_TinySTM103T/variant.cpp @@ -143,15 +143,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { while (1); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/MALYANM200_F070CB/variant.cpp b/variants/MALYANM200_F070CB/variant.cpp index 8f87167321..abec6224e8 100644 --- a/variants/MALYANM200_F070CB/variant.cpp +++ b/variants/MALYANM200_F070CB/variant.cpp @@ -165,15 +165,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/MALYANM200_F103CB/variant.cpp b/variants/MALYANM200_F103CB/variant.cpp index 0c1b045a17..d2e0259e81 100644 --- a/variants/MALYANM200_F103CB/variant.cpp +++ b/variants/MALYANM200_F103CB/variant.cpp @@ -150,13 +150,6 @@ WEAK void SystemClock_Config(void) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB; PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/MAPLEMINI_F103CB/variant.cpp b/variants/MAPLEMINI_F103CB/variant.cpp index df0f7e8e30..4b7b75b721 100644 --- a/variants/MAPLEMINI_F103CB/variant.cpp +++ b/variants/MAPLEMINI_F103CB/variant.cpp @@ -149,15 +149,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { while (1); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F030R8/variant.cpp b/variants/NUCLEO_F030R8/variant.cpp index c3de810a93..a2751e28a3 100644 --- a/variants/NUCLEO_F030R8/variant.cpp +++ b/variants/NUCLEO_F030R8/variant.cpp @@ -145,13 +145,6 @@ WEAK void SystemClock_Config(void) /* Initialization Error */ while (1); } - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F091RC/variant.cpp b/variants/NUCLEO_F091RC/variant.cpp index a4f4fc60ee..80806f2546 100644 --- a/variants/NUCLEO_F091RC/variant.cpp +++ b/variants/NUCLEO_F091RC/variant.cpp @@ -121,13 +121,6 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F103RB/variant.cpp b/variants/NUCLEO_F103RB/variant.cpp index f6b3b9cfec..dd29bf44ef 100644 --- a/variants/NUCLEO_F103RB/variant.cpp +++ b/variants/NUCLEO_F103RB/variant.cpp @@ -152,15 +152,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F207ZG/variant.cpp b/variants/NUCLEO_F207ZG/variant.cpp index f829264512..67e66cbfdb 100644 --- a/variants/NUCLEO_F207ZG/variant.cpp +++ b/variants/NUCLEO_F207ZG/variant.cpp @@ -189,15 +189,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F302R8/variant.cpp b/variants/NUCLEO_F302R8/variant.cpp index 7740bdf748..4e55d58cee 100644 --- a/variants/NUCLEO_F302R8/variant.cpp +++ b/variants/NUCLEO_F302R8/variant.cpp @@ -143,13 +143,6 @@ WEAK void SystemClock_Config(void) /* Initialization Error */ while (1); } - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F303K8/variant.cpp b/variants/NUCLEO_F303K8/variant.cpp index 030e7b86e2..ee888b91fe 100644 --- a/variants/NUCLEO_F303K8/variant.cpp +++ b/variants/NUCLEO_F303K8/variant.cpp @@ -99,15 +99,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { while (1); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F303RE/variant.cpp b/variants/NUCLEO_F303RE/variant.cpp index 43ec34fcfa..3ac3034abe 100644 --- a/variants/NUCLEO_F303RE/variant.cpp +++ b/variants/NUCLEO_F303RE/variant.cpp @@ -128,13 +128,6 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F401RE/variant.cpp b/variants/NUCLEO_F401RE/variant.cpp index 6ccaca1611..46444173d4 100644 --- a/variants/NUCLEO_F401RE/variant.cpp +++ b/variants/NUCLEO_F401RE/variant.cpp @@ -158,12 +158,6 @@ WEAK void SystemClock_Config(void) /* Initialization Error */ while (1); } - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F411RE/variant.cpp b/variants/NUCLEO_F411RE/variant.cpp index 11c7c9a20e..4815bdfa1d 100644 --- a/variants/NUCLEO_F411RE/variant.cpp +++ b/variants/NUCLEO_F411RE/variant.cpp @@ -163,16 +163,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); - } #ifdef __cplusplus } diff --git a/variants/NUCLEO_F429ZI/variant.cpp b/variants/NUCLEO_F429ZI/variant.cpp index 3bf750b1fd..be214a053e 100644 --- a/variants/NUCLEO_F429ZI/variant.cpp +++ b/variants/NUCLEO_F429ZI/variant.cpp @@ -190,13 +190,6 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_F446RE/variant.cpp b/variants/NUCLEO_F446RE/variant.cpp index f1d6d0b7a9..e010e566f4 100644 --- a/variants/NUCLEO_F446RE/variant.cpp +++ b/variants/NUCLEO_F446RE/variant.cpp @@ -187,17 +187,6 @@ WEAK void SystemClock_Config(void) /* Initialization Error */ while (1); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus } diff --git a/variants/NUCLEO_F767ZI/variant.cpp b/variants/NUCLEO_F767ZI/variant.cpp index 79217aa115..0408fc4d7f 100644 --- a/variants/NUCLEO_F767ZI/variant.cpp +++ b/variants/NUCLEO_F767ZI/variant.cpp @@ -202,15 +202,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_G071RB/variant.cpp b/variants/NUCLEO_G071RB/variant.cpp index f7c774de65..20006148ce 100644 --- a/variants/NUCLEO_G071RB/variant.cpp +++ b/variants/NUCLEO_G071RB/variant.cpp @@ -156,15 +156,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_H743ZI/variant.cpp b/variants/NUCLEO_H743ZI/variant.cpp index ee38116c94..8dfde28847 100644 --- a/variants/NUCLEO_H743ZI/variant.cpp +++ b/variants/NUCLEO_H743ZI/variant.cpp @@ -198,15 +198,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(SystemCoreClock / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L031K6/variant.cpp b/variants/NUCLEO_L031K6/variant.cpp index 2de08903ff..b169cd7ff6 100644 --- a/variants/NUCLEO_L031K6/variant.cpp +++ b/variants/NUCLEO_L031K6/variant.cpp @@ -114,15 +114,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L053R8/variant.cpp b/variants/NUCLEO_L053R8/variant.cpp index ce94e59a1d..2948b7d9f9 100644 --- a/variants/NUCLEO_L053R8/variant.cpp +++ b/variants/NUCLEO_L053R8/variant.cpp @@ -136,13 +136,6 @@ WEAK void SystemClock_Config(void) PeriphClkInit.Usart2ClockSelection = RCC_USART2CLKSOURCE_PCLK1; PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L073RZ/variant.cpp b/variants/NUCLEO_L073RZ/variant.cpp index 892ea522d5..807677556c 100644 --- a/variants/NUCLEO_L073RZ/variant.cpp +++ b/variants/NUCLEO_L073RZ/variant.cpp @@ -149,15 +149,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L152RE/variant.cpp b/variants/NUCLEO_L152RE/variant.cpp index 2b0452ca61..76d32c064e 100644 --- a/variants/NUCLEO_L152RE/variant.cpp +++ b/variants/NUCLEO_L152RE/variant.cpp @@ -156,17 +156,6 @@ WEAK void SystemClock_Config(void) /* Initialization Error */ while (1); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus } diff --git a/variants/NUCLEO_L452RE/variant.cpp b/variants/NUCLEO_L452RE/variant.cpp index ba7f967e8f..3bf47dc840 100644 --- a/variants/NUCLEO_L452RE/variant.cpp +++ b/variants/NUCLEO_L452RE/variant.cpp @@ -159,15 +159,6 @@ WEAK void SystemClock_Config(void) } /* Enable MSI Auto calibration */ HAL_RCCEx_EnableMSIPLLMode(); - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L496ZG/variant.cpp b/variants/NUCLEO_L496ZG/variant.cpp index 61ab4a0e7e..4b254d2061 100644 --- a/variants/NUCLEO_L496ZG/variant.cpp +++ b/variants/NUCLEO_L496ZG/variant.cpp @@ -269,17 +269,8 @@ WEAK void SystemClock_Config(void) Error_Handler(); } - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - /* Enable MSI Auto calibration */ HAL_RCCEx_EnableMSIPLLMode(); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/NUCLEO_L4R5ZI/variant.cpp b/variants/NUCLEO_L4R5ZI/variant.cpp index ec64f94167..d063215e35 100644 --- a/variants/NUCLEO_L4R5ZI/variant.cpp +++ b/variants/NUCLEO_L4R5ZI/variant.cpp @@ -266,20 +266,9 @@ WEAK void SystemClock_Config(void) _Error_Handler(__FILE__, __LINE__); } - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - /**Enable MSI Auto calibration */ HAL_RCCEx_EnableMSIPLLMode(); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/PNUCLEO_WB55RG/variant.cpp b/variants/PNUCLEO_WB55RG/variant.cpp index a50e4973b6..67f7b6650c 100644 --- a/variants/PNUCLEO_WB55RG/variant.cpp +++ b/variants/PNUCLEO_WB55RG/variant.cpp @@ -153,14 +153,6 @@ WEAK void SystemClock_Config(void) } /* Enable MSI Auto calibration */ HAL_RCCEx_EnableMSIPLLMode(); - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/PRNTR_F407_V1/variant.cpp b/variants/PRNTR_F407_V1/variant.cpp index 9288a93641..3da2aaa921 100644 --- a/variants/PRNTR_F407_V1/variant.cpp +++ b/variants/PRNTR_F407_V1/variant.cpp @@ -191,17 +191,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/RAK811_TRACKER/variant.cpp b/variants/RAK811_TRACKER/variant.cpp index ae5c08ab82..1120b87f9a 100644 --- a/variants/RAK811_TRACKER/variant.cpp +++ b/variants/RAK811_TRACKER/variant.cpp @@ -127,15 +127,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /* Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /* Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/REMRAM_V1/variant.cpp b/variants/REMRAM_V1/variant.cpp index 2f9a836216..acf2d563ba 100644 --- a/variants/REMRAM_V1/variant.cpp +++ b/variants/REMRAM_V1/variant.cpp @@ -220,15 +220,6 @@ WEAK void SystemClock_Config(void) /**Enables the Clock Security System */ HAL_RCC_EnableCSS(); - - /**Configure the Systick interrupt time */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/REMRAM_V1/variant.h b/variants/REMRAM_V1/variant.h index 770bad36ae..41c4d4a870 100644 --- a/variants/REMRAM_V1/variant.h +++ b/variants/REMRAM_V1/variant.h @@ -175,7 +175,6 @@ extern "C" /* HAL configuration */ #define HSE_VALUE 24000000U -#define TICK_INT_PRIORITY 0x0U #ifdef __cplusplus } // extern "C" diff --git a/variants/RUMBA32_F446VE/variant.cpp b/variants/RUMBA32_F446VE/variant.cpp index 4cb3035aed..6d64ef2a08 100644 --- a/variants/RUMBA32_F446VE/variant.cpp +++ b/variants/RUMBA32_F446VE/variant.cpp @@ -194,13 +194,6 @@ WEAK void SystemClock_Config(void) PeriphClkInitStruct.PLLSAIDivQ = 1; PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } #ifdef __cplusplus diff --git a/variants/SPARKY_F303CC/variant.cpp b/variants/SPARKY_F303CC/variant.cpp index 3cdde56185..35492f5e5d 100644 --- a/variants/SPARKY_F303CC/variant.cpp +++ b/variants/SPARKY_F303CC/variant.cpp @@ -124,18 +124,6 @@ WEAK void SystemClock_Config(void) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); } - - /**Configure the Systick interrupt time - */ - HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000); - - /**Configure the Systick - */ - HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); - - /* SysTick_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); - } #ifdef __cplusplus