Skip to content

Commit

Permalink
AMC2C: Fix PwmInit to manage properly the htim1 registers for MOR_BRE…
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiraz authored and valegagge committed May 5, 2023
1 parent 24cd9a4 commit 106366a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion emBODY/eBcode/arch-arm/board/amc2c/bsp/motorhal/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extern TIM_HandleTypeDef htim1;
#define USE_BREAK_INPUT 0
#else
/* Set to 1 to use emergency BREAK */
#define USE_BREAK_INPUT 1
#define USE_BREAK_INPUT 0
#endif

/* This macro reduce a PWM unsigned value to the value to be loaded in TIM1_CCRx registers */
Expand Down Expand Up @@ -246,6 +246,8 @@ HAL_StatusTypeDef PwmInit(void)
HAL_TIM_Base_Stop_IT(&htim1);

#if defined(MOTORHALCONFIG_MOT_BREAK_IRQ_remove)
htim1.Instance->BDTR &= ~TIM_BDTR_BKE;
htim1.Instance->AF1 &= ~TIM1_AF1_BKINE;
#else

#if USE_BREAK_INPUT != 1
Expand Down

0 comments on commit 106366a

Please sign in to comment.