Skip to content

Commit

Permalink
HardwareTimer: start timer in case only CC interrupts are used
Browse files Browse the repository at this point in the history
Start timer in case only CaptureCompare interrupts are used,
without update interrupt (and without pin used).
fixes stm32duino#1544

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
  • Loading branch information
ABOSTM committed Nov 18, 2021
1 parent 7e56d54 commit 125aaf7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cores/arduino/HardwareTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,13 @@ void HardwareTimer::resumeChannel(uint32_t channel)
HAL_TIM_IC_Start(&(_timerObj.handle), timChannel);
}
break;
case TIMER_NOT_USED:
case TIMER_OUTPUT_COMPARE:
case TIMER_DISABLED:
if (!LL_TIM_IsEnabledCounter(_timerObj.handle.Instance)) {
HAL_TIM_Base_Start(&(_timerObj.handle));
}
break;
case TIMER_NOT_USED:
default :
break;
}
Expand Down

0 comments on commit 125aaf7

Please sign in to comment.