File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -217,20 +217,23 @@ void HardwareTimer::pauseChannel(uint32_t channel)
217217 */
218218void HardwareTimer::resume (void )
219219{
220+ bool baseStart = true ;
221+ for (uint8_t i = 1 ; i <= TIMER_CHANNELS; i++) {
222+ if (_ChannelMode[i - 1 ] != TIMER_OUTPUT_DISABLED) {
223+ resumeChannel (i);
224+ baseStart = false ;
225+ }
226+ }
220227 // Clear flag and enable IT
221228 if (callbacks[0 ]) {
222229 __HAL_TIM_CLEAR_FLAG (&(_timerObj.handle ), TIM_FLAG_UPDATE);
223230 __HAL_TIM_ENABLE_IT (&(_timerObj.handle ), TIM_IT_UPDATE);
231+ }
224232
225- // Start timer in Time base mode. Required when there is no channel used but only update interrupt.
233+ // Start timer in Time base mode. Required when there is no channel used but only update interrupt.
234+ if (baseStart && (!LL_TIM_IsEnabledCounter (_timerObj.handle .Instance ))) {
226235 HAL_TIM_Base_Start (&(_timerObj.handle ));
227236 }
228-
229- // Resume all channels
230- resumeChannel (1 );
231- resumeChannel (2 );
232- resumeChannel (3 );
233- resumeChannel (4 );
234237}
235238
236239/* *
You can’t perform that action at this time.
0 commit comments