pwm master config moved

This commit is contained in:
Thomas Klaehn
2016-08-29 12:10:44 +02:00
parent 48f60f0f73
commit 1407b35ce8
3 changed files with 17 additions and 4 deletions

View File

@@ -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)

View File

@@ -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;