Skip to content

Commit bb4eb87

Browse files
committed
fix enableTimerClock requiring TIM_TypeDef
1 parent f910d7e commit bb4eb87

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/drivers/hardware_specific/stm32/stm32_timerutils.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
#if defined(HAL_TIM_MODULE_ONLY)
88

99
//Functions copied over and modified from HardwareTimer to allow disabling HardwareTimer
10-
1110
void enableTimerClock(TIM_HandleTypeDef *htim)
1211
{
13-
switch ((uintptr_t)htim->Instance)
12+
enableTimerClock(htim->Instance);
13+
}
14+
15+
void enableTimerClock(TIM_TypeDef *tim)
16+
{
17+
switch ((uintptr_t)tim)
1418
{
1519
#if defined(TIM1_BASE)
1620
case TIM1_BASE:

src/drivers/hardware_specific/stm32/stm32_timerutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#if defined(HAL_TIM_MODULE_ONLY)
1111
void enableTimerClock(TIM_HandleTypeDef *htim);
12+
void enableTimerClock(TIM_TypeDef *tim);
1213

1314
constexpr uint8_t getTimerClkSrc(TIM_TypeDef *tim)
1415
{

0 commit comments

Comments
 (0)