Skip to content

HardwareTimer: start timer when only update interrupt needed #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cores/arduino/HardwareTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ void HardwareTimer::resume(void)
if (callbacks[0] != NULL) {
__HAL_TIM_CLEAR_FLAG(&(_timerObj.handle), TIM_FLAG_UPDATE);
__HAL_TIM_ENABLE_IT(&(_timerObj.handle), TIM_IT_UPDATE);

// Start timer in Time base mode. Required when there is no channel used but only update interrupt.
HAL_TIM_Base_Start(&(_timerObj.handle));
}

// Resume all channels
resumeChannel(1);
resumeChannel(2);
Expand Down