Skip to content
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

AMC2C: Fix PwmInit to manage properly the htim1 registers for MOT_BREAK #374

Merged
merged 1 commit into from
Apr 26, 2023
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: 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