From 60b24f8b9bc5539480dbc1f41c6e9ca241e511c0 Mon Sep 17 00:00:00 2001 From: dzid26 Date: Fri, 27 Sep 2024 00:12:29 -0700 Subject: [PATCH] fixed PWM_TIM intialization on power on --- firmware/src/BSP/board.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/src/BSP/board.c b/firmware/src/BSP/board.c index 7458be8..54e8016 100644 --- a/firmware/src/BSP/board.c +++ b/firmware/src/BSP/board.c @@ -206,6 +206,7 @@ static void A4950_init(void) tim_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; tim_OCInitStructure.TIM_OutputNState = TIM_OutputState_Disable; tim_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; + tim_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low; //not used, but need for a reliable TIM1 initialization tim_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Reset; //Motor coasting when idle is set to reset tim_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Reset; tim_OCInitStructure.TIM_Pulse = 0;