From fe34446321ad93bd2ad557a131a197ca0aee58ed Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 29 Sep 2019 16:14:17 +0000 Subject: [PATCH] Enabled ICU on G4. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13051 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/halconf.h | 2 +- demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/mcuconf.h | 7 +++++++ os/hal/ports/STM32/LLD/TIMv1/stm32_tim20.inc | 14 ++++---------- .../conf/mcuconf_stm32g4x4xx/mcuconf.h.ftl | 7 +++++++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/halconf.h b/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/halconf.h index a3abe97ab..757d5a99b 100644 --- a/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/halconf.h +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/halconf.h @@ -86,7 +86,7 @@ * @brief Enables the I2C subsystem. */ #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C TRUE +#define HAL_USE_I2C FALSE #endif /** diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/mcuconf.h b/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/mcuconf.h index 9898824bf..e13239d7c 100644 --- a/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/mcuconf.h +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64/cfg/mcuconf.h @@ -188,6 +188,13 @@ /* * ICU driver system settings. */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM5 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_USE_TIM15 FALSE /* * PWM driver system settings. diff --git a/os/hal/ports/STM32/LLD/TIMv1/stm32_tim20.inc b/os/hal/ports/STM32/LLD/TIMv1/stm32_tim20.inc index b311ffccd..266598a28 100644 --- a/os/hal/ports/STM32/LLD/TIMv1/stm32_tim20.inc +++ b/os/hal/ports/STM32/LLD/TIMv1/stm32_tim20.inc @@ -86,8 +86,7 @@ static inline void tim20_irq_deinit(void) { /* Driver interrupt handlers. */ /*===========================================================================*/ -#if (HAL_USE_ICU && STM32_ICU_USE_TIM20) || \ - (HAL_USE_PWM && STM32_PWM_USE_TIM20) || \ +#if (HAL_USE_PWM && STM32_PWM_USE_TIM20) || \ defined(__DOXYGEN__) /** * @brief TIM20-UP interrupt handler. @@ -102,9 +101,7 @@ OSAL_IRQ_HANDLER(STM32_TIM20_UP_HANDLER) { /* Not used by GPT.*/ #endif #if HAL_USE_ICU -#if STM32_ICU_USE_TIM20 - icu_lld_serve_interrupt(&ICUD20); -#endif + /* Not used by ICU.*/ #endif #if HAL_USE_PWM #if STM32_PWM_USE_TIM20 @@ -116,8 +113,7 @@ OSAL_IRQ_HANDLER(STM32_TIM20_UP_HANDLER) { } #endif -#if (HAL_USE_ICU && STM32_ICU_USE_TIM20) || \ - (HAL_USE_PWM && STM32_PWM_USE_TIM20) || \ +#if (HAL_USE_PWM && STM32_PWM_USE_TIM20) || \ defined(__DOXYGEN__) /** * @brief TIM20-CC interrupt handler. @@ -132,9 +128,7 @@ OSAL_IRQ_HANDLER(STM32_TIM20_CC_HANDLER) { /* Not used by GPT.*/ #endif #if HAL_USE_ICU -#if STM32_ICU_USE_TIM20 - icu_lld_serve_interrupt(&ICUD20); -#endif + /* Not used by ICU.*/ #endif #if HAL_USE_PWM #if STM32_PWM_USE_TIM20 diff --git a/tools/ftl/processors/conf/mcuconf_stm32g4x4xx/mcuconf.h.ftl b/tools/ftl/processors/conf/mcuconf_stm32g4x4xx/mcuconf.h.ftl index ecc8dfc98..c0b5c26c6 100644 --- a/tools/ftl/processors/conf/mcuconf_stm32g4x4xx/mcuconf.h.ftl +++ b/tools/ftl/processors/conf/mcuconf_stm32g4x4xx/mcuconf.h.ftl @@ -199,6 +199,13 @@ /* * ICU driver system settings. */ +#define STM32_ICU_USE_TIM1 ${doc.STM32_ICU_USE_TIM1!"FALSE"} +#define STM32_ICU_USE_TIM2 ${doc.STM32_ICU_USE_TIM2!"FALSE"} +#define STM32_ICU_USE_TIM3 ${doc.STM32_ICU_USE_TIM3!"FALSE"} +#define STM32_ICU_USE_TIM4 ${doc.STM32_ICU_USE_TIM4!"FALSE"} +#define STM32_ICU_USE_TIM5 ${doc.STM32_ICU_USE_TIM5!"FALSE"} +#define STM32_ICU_USE_TIM8 ${doc.STM32_ICU_USE_TIM8!"FALSE"} +#define STM32_ICU_USE_TIM15 ${doc.STM32_ICU_USE_TIM15!"FALSE"} /* * PWM driver system settings.