Skip to content

Commit 757493c

Browse files
ABOSTMfpistm
authored andcommitted
HardwareTimer: start timer when only update interrupt needed
no more need to use setMode() when only update interrupt required. Simplify timebase interrupt usage: see #841
1 parent 849a8be commit 757493c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: cores/arduino/HardwareTimer.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ void HardwareTimer::resume(void)
158158
if (callbacks[0] != NULL) {
159159
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), TIM_FLAG_UPDATE);
160160
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), TIM_IT_UPDATE);
161+
162+
// Start timer in Time base mode. Required when there is no channel used but only update interrupt.
163+
HAL_TIM_Base_Start(&(_timerObj.handle));
161164
}
165+
162166
// Resume all channels
163167
resumeChannel(1);
164168
resumeChannel(2);

0 commit comments

Comments
 (0)