From 232ae706e91fb0113591dab7116965c7c2b09351 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 12 Sep 2013 13:33:12 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6295 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/nil/NIL-STM32F051-DISCOVERY/mcuconf.h | 1 + demos/nil/NIL-STM32F303-DISCOVERY/mcuconf.h | 1 + .../NIL-STM32F373-STM32373C_EVAL/mcuconf.h | 6 ++ demos/nil/NIL-STM32L152-DISCOVERY/mcuconf.h | 6 ++ demos/rt/RT-STM32F051-DISCOVERY/mcuconf.h | 1 + demos/rt/RT-STM32F303-DISCOVERY/mcuconf.h | 1 + .../rt/RT-STM32F407-DISCOVERY-MEMS/mcuconf.h | 6 ++ demos/rt/RT-STM32F407-DISCOVERY/mcuconf.h | 6 ++ os/hal/ports/STM32/TIMv1/st_lld.c | 81 ++++++++++--------- os/hal/ports/STM32/TIMv1/st_lld.h | 41 +++++++--- os/rt/osal/osal.h | 11 +++ testhal/STM32F0xx/ADC/mcuconf.h | 1 + testhal/STM32F0xx/EXT/mcuconf.h | 1 + testhal/STM32F0xx/IRQ_STORM/mcuconf.h | 1 + testhal/STM32F0xx/PWM-ICU/mcuconf.h | 1 + testhal/STM32F0xx/SPI/mcuconf.h | 1 + testhal/STM32F0xx/UART/mcuconf.h | 1 + testhal/STM32F30x/ADC/mcuconf.h | 1 + testhal/STM32F30x/ADC_DUAL/mcuconf.h | 1 + testhal/STM32F30x/CAN/mcuconf.h | 1 + testhal/STM32F30x/EXT/mcuconf.h | 1 + testhal/STM32F30x/IRQ_STORM/mcuconf.h | 1 + testhal/STM32F30x/PWM-ICU/mcuconf.h | 1 + testhal/STM32F30x/SPI/mcuconf.h | 1 + testhal/STM32F30x/UART/mcuconf.h | 1 + testhal/STM32F30x/USB_CDC/mcuconf.h | 1 + testhal/STM32F4xx/ADC/mcuconf.h | 6 ++ testhal/STM32F4xx/CAN/mcuconf.h | 6 ++ testhal/STM32F4xx/DMA_STORM/mcuconf.h | 6 ++ testhal/STM32F4xx/EXT/mcuconf.h | 6 ++ testhal/STM32F4xx/GPT/mcuconf.h | 6 ++ testhal/STM32F4xx/I2C/mcuconf.h | 6 ++ testhal/STM32F4xx/IRQ_STORM/mcuconf.h | 6 ++ testhal/STM32F4xx/IRQ_STORM_FPU/mcuconf.h | 6 ++ testhal/STM32F4xx/PWM-ICU/mcuconf.h | 6 ++ testhal/STM32F4xx/RTC/mcuconf.h | 6 ++ testhal/STM32F4xx/SDC/mcuconf.h | 6 ++ testhal/STM32F4xx/SPI/mcuconf.h | 6 ++ testhal/STM32F4xx/UART/mcuconf.h | 6 ++ testhal/STM32F4xx/USB_CDC/mcuconf.h | 6 ++ 40 files changed, 213 insertions(+), 47 deletions(-) diff --git a/demos/nil/NIL-STM32F051-DISCOVERY/mcuconf.h b/demos/nil/NIL-STM32F051-DISCOVERY/mcuconf.h index fdcd8a2a4..98c62521c 100644 --- a/demos/nil/NIL-STM32F051-DISCOVERY/mcuconf.h +++ b/demos/nil/NIL-STM32F051-DISCOVERY/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/demos/nil/NIL-STM32F303-DISCOVERY/mcuconf.h b/demos/nil/NIL-STM32F303-DISCOVERY/mcuconf.h index cb30c7241..df3ca72b9 100644 --- a/demos/nil/NIL-STM32F303-DISCOVERY/mcuconf.h +++ b/demos/nil/NIL-STM32F303-DISCOVERY/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/demos/nil/NIL-STM32F373-STM32373C_EVAL/mcuconf.h b/demos/nil/NIL-STM32F373-STM32373C_EVAL/mcuconf.h index 2dd58d1a9..272ee34b7 100644 --- a/demos/nil/NIL-STM32F373-STM32373C_EVAL/mcuconf.h +++ b/demos/nil/NIL-STM32F373-STM32373C_EVAL/mcuconf.h @@ -186,6 +186,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/demos/nil/NIL-STM32L152-DISCOVERY/mcuconf.h b/demos/nil/NIL-STM32L152-DISCOVERY/mcuconf.h index 01cd9ee48..7efe82f94 100644 --- a/demos/nil/NIL-STM32L152-DISCOVERY/mcuconf.h +++ b/demos/nil/NIL-STM32L152-DISCOVERY/mcuconf.h @@ -147,6 +147,12 @@ #define STM32_SPI_SPI2_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/demos/rt/RT-STM32F051-DISCOVERY/mcuconf.h b/demos/rt/RT-STM32F051-DISCOVERY/mcuconf.h index fdcd8a2a4..98c62521c 100644 --- a/demos/rt/RT-STM32F051-DISCOVERY/mcuconf.h +++ b/demos/rt/RT-STM32F051-DISCOVERY/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/demos/rt/RT-STM32F303-DISCOVERY/mcuconf.h b/demos/rt/RT-STM32F303-DISCOVERY/mcuconf.h index cb30c7241..df3ca72b9 100644 --- a/demos/rt/RT-STM32F303-DISCOVERY/mcuconf.h +++ b/demos/rt/RT-STM32F303-DISCOVERY/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/demos/rt/RT-STM32F407-DISCOVERY-MEMS/mcuconf.h b/demos/rt/RT-STM32F407-DISCOVERY-MEMS/mcuconf.h index 838e3298b..1ada2776c 100644 --- a/demos/rt/RT-STM32F407-DISCOVERY-MEMS/mcuconf.h +++ b/demos/rt/RT-STM32F407-DISCOVERY-MEMS/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/demos/rt/RT-STM32F407-DISCOVERY/mcuconf.h b/demos/rt/RT-STM32F407-DISCOVERY/mcuconf.h index 4ea0f59cf..1b7e1261e 100644 --- a/demos/rt/RT-STM32F407-DISCOVERY/mcuconf.h +++ b/demos/rt/RT-STM32F407-DISCOVERY/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/os/hal/ports/STM32/TIMv1/st_lld.c b/os/hal/ports/STM32/TIMv1/st_lld.c index 8e4a4e84e..a8b858e8c 100644 --- a/os/hal/ports/STM32/TIMv1/st_lld.c +++ b/os/hal/ports/STM32/TIMv1/st_lld.c @@ -31,26 +31,45 @@ /* The following checks and settings are unusually done here because the file st.h needs to not have external dependencies. In this case there would be a dependency on osal.h and mcuconf.h.*/ -#if !defined(HAL_ST_USE_TIM5) - -#if !STM32_HAS_TIM2 -#error "TIM2 not present in the selected device" +#if STM32_ST_USE_TIMER == 2 +#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM2_IS_32BITS +#error "TIM2 is not a 32bits timer" #endif -#if !STM32_TIM2_IS_32BITS -#error "TIM2 is not a 32 bits timer" +#define ST_HANDLER STM32_TIM2_HANDLER +#define ST_NUMBER STM32_TIM2_NUMBER +#define ST_ENABLE_CLOCK() rccEnableTIM2(FALSE) + +#elif STM32_ST_USE_TIMER == 5 +#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM5_IS_32BITS +#error "TIM5 is not a 32bits timer" #endif -#else /* defined(HAL_ST_USE_TIM5) */ +#define ST_HANDLER STM32_TIM5_HANDLER +#define ST_NUMBER STM32_TIM5_NUMBER +#define ST_ENABLE_CLOCK() rccEnableTIM5(FALSE) -#if !STM32_HAS_TIM5 -#error "TIM5 not present in the selected device" +#elif STM32_ST_USE_TIMER == 6 +#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM6_IS_32BITS +#error "TIM6 is not a 32bits timer" #endif -#if !STM32_TIM5_IS_32BITS -#error "TIM5 is not a 32 bits timer" +#define ST_HANDLER STM32_TIM6_HANDLER +#define ST_NUMBER STM32_TIM6_NUMBER +#define ST_ENABLE_CLOCK() rccEnableTIM6(FALSE) + +#elif STM32_ST_USE_TIMER == 7 +#if (OSAL_ST_RESOLUTION == 32) && !STM32_TIM7_IS_32BITS +#error "TIM7 is not a 32bits timer" +#endif + +#define ST_HANDLER STM32_TIM7_HANDLER +#define ST_NUMBER STM32_TIM7_NUMBER +#define ST_ENABLE_CLOCK() rccEnableTIM7(FALSE) + +#else +#error "STM32_ST_USE_TIMER specifies an unsupported timer" #endif -#endif /* defined(HAL_ST_USE_TIM5) */ #endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */ @@ -116,15 +135,11 @@ OSAL_IRQ_HANDLER(SysTick_Handler) { * * @isr */ -#if !defined(HAL_ST_USE_TIM5) -OSAL_IRQ_HANDLER(STM32_TIM2_HANDLER) { -#else -OSAL_IRQ_HANDLER(STM32_TIM5_HANDLER) { -#endif +OSAL_IRQ_HANDLER(ST_HANDLER) { OSAL_IRQ_PROLOGUE(); - ST_TIM->SR = 0; + STM32_ST_TIM->SR = 0; osalSysLockFromISR(); osalOsTimerHandlerI(); @@ -147,28 +162,22 @@ void st_lld_init(void) { #if OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING /* Free running counter mode.*/ -#if !defined(HAL_ST_USE_TIM5) - rccEnableTIM2(FALSE); -#else - rccEnableTIM5(FALSE); -#endif + + /* Enabling timer clock.*/ + ST_ENABLE_CLOCK(); /* Initializing the counter in free running mode.*/ - ST_TIM->PSC = STM32_TIMCLK1 / OSAL_SYSTICK_FREQUENCY - 1; - ST_TIM->ARR = 0xFFFFFFFF; - ST_TIM->CCMR1 = 0; - ST_TIM->CCR[0] = 0; - ST_TIM->DIER = 0; - ST_TIM->CR2 = 0; - ST_TIM->EGR = TIM_EGR_UG; - ST_TIM->CR1 = TIM_CR1_CEN; + STM32_ST_TIM->PSC = STM32_TIMCLK1 / OSAL_SYSTICK_FREQUENCY - 1; + STM32_ST_TIM->ARR = 0xFFFFFFFF; + STM32_ST_TIM->CCMR1 = 0; + STM32_ST_TIM->CCR[0] = 0; + STM32_ST_TIM->DIER = 0; + STM32_ST_TIM->CR2 = 0; + STM32_ST_TIM->EGR = TIM_EGR_UG; + STM32_ST_TIM->CR1 = TIM_CR1_CEN; /* IRQ enabled.*/ -#if !defined(HAL_ST_USE_TIM5) - nvicEnableVector(STM32_TIM2_NUMBER, STM32_ST_IRQ_PRIORITY); -#else - nvicEnableVector(STM32_TIM5_NUMBER, STM32_ST_IRQ_PRIORITY); -#endif + nvicEnableVector(ST_NUMBER, STM32_ST_IRQ_PRIORITY); #endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */ #if OSAL_ST_MODE == OSAL_ST_MODE_PERIODIC diff --git a/os/hal/ports/STM32/TIMv1/st_lld.h b/os/hal/ports/STM32/TIMv1/st_lld.h index 4a969738c..0013d7913 100644 --- a/os/hal/ports/STM32/TIMv1/st_lld.h +++ b/os/hal/ports/STM32/TIMv1/st_lld.h @@ -38,14 +38,33 @@ /* Driver pre-compile time settings. */ /*===========================================================================*/ +/** + * @brief TIMx unit (by number) to be used for free running operations. + * @note You must select a 32 bits timer if a 32 bits systick_t is + * required. + */ +#if !defined(STM32_ST_USE_TIMER) || defined(__DOXYGEN__) +#define STM32_ST_USE_TIMER 2 +#endif + /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ -#if !defined(HAL_ST_USE_TIM5) -#define ST_TIM STM32_TIM2 +#if STM32_ST_USE_TIMER == 2 +#define STM32_ST_TIM STM32_TIM2 + +#elif STM32_ST_USE_TIMER == 5 +#define STM32_ST_TIM STM32_TIM5 + +#elif STM32_ST_USE_TIMER == 6 +#define STM32_ST_TIM STM32_TIM6 + +#elif STM32_ST_USE_TIMER == 7 +#define STM32_ST_TIM STM32_TIM7 + #else -#define ST_TIM STM32_TIM5 +#error "STM32_ST_USE_TIMER specifies an unsupported timer" #endif /*===========================================================================*/ @@ -81,7 +100,7 @@ extern "C" { */ static inline systime_t st_lld_get_counter(void) { - return (systime_t)(ST_TIM->CNT); + return (systime_t)STM32_ST_TIM->CNT; } /** @@ -95,9 +114,9 @@ static inline systime_t st_lld_get_counter(void) { */ static inline void st_lld_start_alarm(systime_t time) { - ST_TIM->CCR[0] = time; - ST_TIM->SR = 0; - ST_TIM->DIER = STM32_TIM_DIER_CC1IE; + STM32_ST_TIM->CCR[0] = (uint32_t)time; + STM32_ST_TIM->SR = 0; + STM32_ST_TIM->DIER = STM32_TIM_DIER_CC1IE; } /** @@ -107,7 +126,7 @@ static inline void st_lld_start_alarm(systime_t time) { */ static inline void st_lld_stop_alarm(void) { - ST_TIM->DIER = 0; + STM32_ST_TIM->DIER = 0; } /** @@ -119,7 +138,7 @@ static inline void st_lld_stop_alarm(void) { */ static inline void st_lld_set_alarm(systime_t time) { - ST_TIM->CCR[0] = (uint32_t)time; + STM32_ST_TIM->CCR[0] = (uint32_t)time; } /** @@ -131,7 +150,7 @@ static inline void st_lld_set_alarm(systime_t time) { */ static inline systime_t st_lld_get_alarm(void) { - return (systime_t)ST_TIM->CCR[0]; + return (systime_t)STM32_ST_TIM->CCR[0]; } /** @@ -145,7 +164,7 @@ static inline systime_t st_lld_get_alarm(void) { */ static inline bool st_lld_is_alarm_active(void) { - return (bool)((ST_TIM->DIER & STM32_TIM_DIER_CC1IE) != 0); + return (bool)((STM32_ST_TIM->DIER & STM32_TIM_DIER_CC1IE) != 0); } #endif /* _ST_LLD_H_ */ diff --git a/os/rt/osal/osal.h b/os/rt/osal/osal.h index 04b9ba76a..edaa34547 100644 --- a/os/rt/osal/osal.h +++ b/os/rt/osal/osal.h @@ -85,6 +85,13 @@ #define OSAL_ST_MODE_FREERUNNING 2 /** @} */ +/** + * @name Systick resolution. + * @{ + */ +#define OSAL_ST_RESOLUTION CH_CFG_ST_RESOLUTION +/** @} */ + /** * @brief Systick mode required by the underlying OS. */ @@ -113,6 +120,10 @@ #error "invalid OSAL_ST_MODE setting in osal.h" #endif +#if (OSAL_ST_RESOLUTION != 16) && (OSAL_ST_RESOLUTION != 32) +#error "invalid OSAL_ST_RESOLUTION, must be 16 or 32" +#endif + /*===========================================================================*/ /* Module data structures and types. */ /*===========================================================================*/ diff --git a/testhal/STM32F0xx/ADC/mcuconf.h b/testhal/STM32F0xx/ADC/mcuconf.h index b7c0841e5..652af90a1 100644 --- a/testhal/STM32F0xx/ADC/mcuconf.h +++ b/testhal/STM32F0xx/ADC/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F0xx/EXT/mcuconf.h b/testhal/STM32F0xx/EXT/mcuconf.h index 675b3d5ad..df3f85580 100644 --- a/testhal/STM32F0xx/EXT/mcuconf.h +++ b/testhal/STM32F0xx/EXT/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F0xx/IRQ_STORM/mcuconf.h b/testhal/STM32F0xx/IRQ_STORM/mcuconf.h index cd6d20966..2a9c91850 100644 --- a/testhal/STM32F0xx/IRQ_STORM/mcuconf.h +++ b/testhal/STM32F0xx/IRQ_STORM/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F0xx/PWM-ICU/mcuconf.h b/testhal/STM32F0xx/PWM-ICU/mcuconf.h index a8c5744c1..b4678a1f6 100644 --- a/testhal/STM32F0xx/PWM-ICU/mcuconf.h +++ b/testhal/STM32F0xx/PWM-ICU/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F0xx/SPI/mcuconf.h b/testhal/STM32F0xx/SPI/mcuconf.h index dbe57d294..33146eb6a 100644 --- a/testhal/STM32F0xx/SPI/mcuconf.h +++ b/testhal/STM32F0xx/SPI/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F0xx/UART/mcuconf.h b/testhal/STM32F0xx/UART/mcuconf.h index eab34eb67..1fd22d532 100644 --- a/testhal/STM32F0xx/UART/mcuconf.h +++ b/testhal/STM32F0xx/UART/mcuconf.h @@ -140,6 +140,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/ADC/mcuconf.h b/testhal/STM32F30x/ADC/mcuconf.h index 77c6109c1..7838058a0 100644 --- a/testhal/STM32F30x/ADC/mcuconf.h +++ b/testhal/STM32F30x/ADC/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/ADC_DUAL/mcuconf.h b/testhal/STM32F30x/ADC_DUAL/mcuconf.h index f73d74e64..3468f7e92 100644 --- a/testhal/STM32F30x/ADC_DUAL/mcuconf.h +++ b/testhal/STM32F30x/ADC_DUAL/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/CAN/mcuconf.h b/testhal/STM32F30x/CAN/mcuconf.h index 5391ed9eb..86e830fe2 100644 --- a/testhal/STM32F30x/CAN/mcuconf.h +++ b/testhal/STM32F30x/CAN/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/EXT/mcuconf.h b/testhal/STM32F30x/EXT/mcuconf.h index 9ba948995..abb99ae10 100644 --- a/testhal/STM32F30x/EXT/mcuconf.h +++ b/testhal/STM32F30x/EXT/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/IRQ_STORM/mcuconf.h b/testhal/STM32F30x/IRQ_STORM/mcuconf.h index ee0b2a875..082f71c8f 100644 --- a/testhal/STM32F30x/IRQ_STORM/mcuconf.h +++ b/testhal/STM32F30x/IRQ_STORM/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/PWM-ICU/mcuconf.h b/testhal/STM32F30x/PWM-ICU/mcuconf.h index cc1b46815..bb59d7e27 100644 --- a/testhal/STM32F30x/PWM-ICU/mcuconf.h +++ b/testhal/STM32F30x/PWM-ICU/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/SPI/mcuconf.h b/testhal/STM32F30x/SPI/mcuconf.h index 8a2445f27..8ba3d4ea8 100644 --- a/testhal/STM32F30x/SPI/mcuconf.h +++ b/testhal/STM32F30x/SPI/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/UART/mcuconf.h b/testhal/STM32F30x/UART/mcuconf.h index f4f9eb3ce..f3ebfcc2a 100644 --- a/testhal/STM32F30x/UART/mcuconf.h +++ b/testhal/STM32F30x/UART/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F30x/USB_CDC/mcuconf.h b/testhal/STM32F30x/USB_CDC/mcuconf.h index 52b6ca5a4..57f596299 100644 --- a/testhal/STM32F30x/USB_CDC/mcuconf.h +++ b/testhal/STM32F30x/USB_CDC/mcuconf.h @@ -194,6 +194,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/testhal/STM32F4xx/ADC/mcuconf.h b/testhal/STM32F4xx/ADC/mcuconf.h index 1b482ab1a..1ddd2e50b 100644 --- a/testhal/STM32F4xx/ADC/mcuconf.h +++ b/testhal/STM32F4xx/ADC/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/CAN/mcuconf.h b/testhal/STM32F4xx/CAN/mcuconf.h index 5cc664ba5..1f540eb54 100644 --- a/testhal/STM32F4xx/CAN/mcuconf.h +++ b/testhal/STM32F4xx/CAN/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/DMA_STORM/mcuconf.h b/testhal/STM32F4xx/DMA_STORM/mcuconf.h index ca926eff4..7d95bc527 100644 --- a/testhal/STM32F4xx/DMA_STORM/mcuconf.h +++ b/testhal/STM32F4xx/DMA_STORM/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/EXT/mcuconf.h b/testhal/STM32F4xx/EXT/mcuconf.h index 111dcb990..861a2d560 100644 --- a/testhal/STM32F4xx/EXT/mcuconf.h +++ b/testhal/STM32F4xx/EXT/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/GPT/mcuconf.h b/testhal/STM32F4xx/GPT/mcuconf.h index 202e09743..ff0f33ac3 100644 --- a/testhal/STM32F4xx/GPT/mcuconf.h +++ b/testhal/STM32F4xx/GPT/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/I2C/mcuconf.h b/testhal/STM32F4xx/I2C/mcuconf.h index 3cd35c6c9..3e68b2801 100644 --- a/testhal/STM32F4xx/I2C/mcuconf.h +++ b/testhal/STM32F4xx/I2C/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/IRQ_STORM/mcuconf.h b/testhal/STM32F4xx/IRQ_STORM/mcuconf.h index b5597bde6..7f674ff01 100644 --- a/testhal/STM32F4xx/IRQ_STORM/mcuconf.h +++ b/testhal/STM32F4xx/IRQ_STORM/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/IRQ_STORM_FPU/mcuconf.h b/testhal/STM32F4xx/IRQ_STORM_FPU/mcuconf.h index b5597bde6..7f674ff01 100644 --- a/testhal/STM32F4xx/IRQ_STORM_FPU/mcuconf.h +++ b/testhal/STM32F4xx/IRQ_STORM_FPU/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/PWM-ICU/mcuconf.h b/testhal/STM32F4xx/PWM-ICU/mcuconf.h index b492450ab..e321c9a4f 100644 --- a/testhal/STM32F4xx/PWM-ICU/mcuconf.h +++ b/testhal/STM32F4xx/PWM-ICU/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/RTC/mcuconf.h b/testhal/STM32F4xx/RTC/mcuconf.h index d6499e99a..a5ad6c8d9 100644 --- a/testhal/STM32F4xx/RTC/mcuconf.h +++ b/testhal/STM32F4xx/RTC/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/SDC/mcuconf.h b/testhal/STM32F4xx/SDC/mcuconf.h index 4ea0f59cf..1b7e1261e 100644 --- a/testhal/STM32F4xx/SDC/mcuconf.h +++ b/testhal/STM32F4xx/SDC/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/SPI/mcuconf.h b/testhal/STM32F4xx/SPI/mcuconf.h index 26d037dd9..6e49d3242 100644 --- a/testhal/STM32F4xx/SPI/mcuconf.h +++ b/testhal/STM32F4xx/SPI/mcuconf.h @@ -239,6 +239,12 @@ #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") /* +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + * UART driver system settings. */ #define STM32_UART_USE_USART1 FALSE diff --git a/testhal/STM32F4xx/UART/mcuconf.h b/testhal/STM32F4xx/UART/mcuconf.h index 0c728db6c..35b022b1e 100644 --- a/testhal/STM32F4xx/UART/mcuconf.h +++ b/testhal/STM32F4xx/UART/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */ diff --git a/testhal/STM32F4xx/USB_CDC/mcuconf.h b/testhal/STM32F4xx/USB_CDC/mcuconf.h index 3a81db0e7..1b8b2b79b 100644 --- a/testhal/STM32F4xx/USB_CDC/mcuconf.h +++ b/testhal/STM32F4xx/USB_CDC/mcuconf.h @@ -238,6 +238,12 @@ #define STM32_SPI_SPI3_IRQ_PRIORITY 10 #define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + /* * UART driver system settings. */