mcpwm: fix second fault line broken
Closes:
@@ -502,15 +502,12 @@ esp_err_t mcpwm_fault_set_cyc_mode(mcpwm_unit_t mcpwm_num, mcpwm_timer_t timer_n
const int op = timer_num;
MCPWM_TIMER_CHECK(mcpwm_num, op);
mcpwm_hal_context_t *hal = &context[mcpwm_num].hal;
- mcpwm_hal_fault_conf_t fault_conf = {
- .cbc_enabled_mask = BIT(fault_sig),
- .ost_enabled_mask = 0,
- .action_on_fault[0] = action_on_pwmxa,
- .action_on_fault[1] = action_on_pwmxb,
- };
mcpwm_critical_enter(mcpwm_num);
- mcpwm_hal_operator_update_fault(hal, op, &fault_conf);
+ mcpwm_ll_fault_cbc_enable_signal(hal->dev, op, fault_sig, true);
+ mcpwm_ll_fault_oneshot_enable_signal(hal->dev, op, fault_sig, false);
+ mcpwm_ll_fault_set_cyc_action(hal->dev, op, 0, action_on_pwmxa, action_on_pwmxa);
+ mcpwm_ll_fault_set_cyc_action(hal->dev, op, 1, action_on_pwmxb, action_on_pwmxb);
mcpwm_critical_exit(mcpwm_num);
return ESP_OK;
}
@@ -522,16 +519,13 @@ esp_err_t mcpwm_fault_set_oneshot_mode(mcpwm_unit_t mcpwm_num, mcpwm_timer_t tim
const int op = timer_num;
MCPWM_TIMER_CHECK(mcpwm_num, op);
mcpwm_hal_context_t *hal = &context[mcpwm_num].hal;
- mcpwm_hal_fault_conf_t fault_conf = {
- .cbc_enabled_mask = 0,
- .ost_enabled_mask = BIT(fault_sig),
- .action_on_fault[0] = action_on_pwmxa,
- .action_on_fault[1] = action_on_pwmxb,
- };
mcpwm_critical_enter(mcpwm_num);
mcpwm_hal_fault_oneshot_clear(hal, op);
- mcpwm_hal_operator_update_fault(hal, op, &fault_conf);
+ mcpwm_ll_fault_cbc_enable_signal(hal->dev, op, fault_sig, false);
+ mcpwm_ll_fault_oneshot_enable_signal(hal->dev, op, fault_sig, true);
+ mcpwm_ll_fault_set_oneshot_action(hal->dev, op, 0, action_on_pwmxa, action_on_pwmxa);
+ mcpwm_ll_fault_set_oneshot_action(hal->dev, op, 1, action_on_pwmxb, action_on_pwmxb);
mcpwm_critical_exit(mcpwm_num);
return ESP_OK;
}
