Skip to content

Commit ff70bd1

Browse files
pi-anldpgeorge
authored andcommitted
stm32/timer: Fix deadtime config on Advanced Timer peripherals.
Newer MCU series have additional fields in the struct which need to be initialised to zero, eg Break2AFMode on WB55. This work was funded by Planet Innovation. Signed-off-by: Andrew Leech <[email protected]>
1 parent 8dbdac8 commit ff70bd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/stm32/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ STATIC mp_int_t compute_ticks_from_dtg(uint32_t dtg) {
507507
}
508508

509509
STATIC void config_deadtime(pyb_timer_obj_t *self, mp_int_t ticks, mp_int_t brk) {
510-
TIM_BreakDeadTimeConfigTypeDef deadTimeConfig;
510+
TIM_BreakDeadTimeConfigTypeDef deadTimeConfig = {0};
511511
deadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
512512
deadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE;
513513
deadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF;

0 commit comments

Comments
 (0)