diff options
| author | Meco Man <[email protected]> | 2022-05-09 12:19:21 -0400 |
|---|---|---|
| committer | guo <[email protected]> | 2022-05-10 13:55:16 +0800 |
| commit | 8a7b9da76d1f0ce6f39ef2899e2f335d2a0b29a3 (patch) | |
| tree | 513d08e169659073df4aabf832890df92449dbec /bsp/stm32/libraries | |
| parent | b9902b2fac41cec286715507df048b6d97d118a2 (diff) | |
[stm32 nucleo][f072][f401] support TIM7/TIM11 hardware timer
Diffstat (limited to 'bsp/stm32/libraries')
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/config/f0/tim_config.h | 11 | ||||
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/config/f0/tim_config.h b/bsp/stm32/libraries/HAL_Drivers/config/f0/tim_config.h index ca37509e02..82255b76db 100644 --- a/bsp/stm32/libraries/HAL_Drivers/config/f0/tim_config.h +++ b/bsp/stm32/libraries/HAL_Drivers/config/f0/tim_config.h @@ -27,6 +27,17 @@ extern "C" { } #endif /* TIM_DEV_INFO_CONFIG */ +#ifdef BSP_USING_TIM7 +#ifndef TIM7_CONFIG +#define TIM7_CONFIG \ + { \ + .tim_handle.Instance = TIM7, \ + .tim_irqn = TIM7_IRQn, \ + .name = "timer7", \ + } +#endif /* TIM7_CONFIG */ +#endif /* BSP_USING_TIM7 */ + #ifdef BSP_USING_TIM14 #ifndef TIM14_CONFIG #define TIM14_CONFIG \ diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c index 7153540505..c8167995fb 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_hwtimer.c @@ -599,7 +599,8 @@ static int stm32_hwtimer_init(void) { stm32_hwtimer_obj[i].time_device.info = &_info; stm32_hwtimer_obj[i].time_device.ops = &_ops; - if (rt_device_hwtimer_register(&stm32_hwtimer_obj[i].time_device, stm32_hwtimer_obj[i].name, &stm32_hwtimer_obj[i].tim_handle) == RT_EOK) + if (rt_device_hwtimer_register(&stm32_hwtimer_obj[i].time_device, + stm32_hwtimer_obj[i].name, &stm32_hwtimer_obj[i].tim_handle) == RT_EOK) { LOG_D("%s register success", stm32_hwtimer_obj[i].name); } |
