pwm master config moved
This commit is contained in:
@@ -14,6 +14,7 @@ struct stm32f4_pwm {
|
||||
const struct stm32f4_gpio *pwm_gpio;
|
||||
TIM_HandleTypeDef *timer_handle;
|
||||
TIM_OC_InitTypeDef *output_compare_cfg;
|
||||
TIM_MasterConfigTypeDef *master_cfg;
|
||||
uint32_t channel;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
@@ -30,10 +30,7 @@ int stm32f4_pwm_open(const void *pwm)
|
||||
HAL_TIM_PWM_Init(this->timer_handle);
|
||||
HAL_TIM_PWM_ConfigChannel(this->timer_handle, this->output_compare_cfg, this->channel);
|
||||
|
||||
TIM_MasterConfigTypeDef sMasterConfig;
|
||||
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
|
||||
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
|
||||
HAL_TIMEx_MasterConfigSynchronization(this->timer_handle, &sMasterConfig);
|
||||
HAL_TIMEx_MasterConfigSynchronization(this->timer_handle, this->master_cfg);
|
||||
|
||||
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;
|
||||
sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE;
|
||||
|
Reference in New Issue
Block a user