fix(mcpwm): add warning about generator deadtime

Closes https://github.com/espressif/esp-idf/issues/14773
This commit is contained in:
Chen Jichang
2024-10-24 21:56:21 +08:00
parent a974ea3a9a
commit 1f0ba8f4b1
2 changed files with 5 additions and 1 deletions

View File

@ -389,6 +389,10 @@ esp_err_t mcpwm_generator_set_dead_time(mcpwm_gen_handle_t in_generator, mcpwm_g
mcpwm_ll_deadtime_set_falling_delay(hal->dev, oper_id, config->negedge_delay_ticks);
}
if (delay_on_both_edge && in_generator->gen_id == 0 && oper->generators[1]) {
ESP_LOGW(TAG, "generator B will not function correctly. To set deadtime on both edges for one generator while bypassing the deadtime for the other, please set the deadtime for generator B only.");
}
ESP_LOGD(TAG, "operator (%d,%d) dead time (R:%"PRIu32",F:%"PRIu32"), topology code:%"PRIx32, group->group_id, oper_id,
config->posedge_delay_ticks, config->negedge_delay_ticks, mcpwm_ll_deadtime_get_switch_topology(hal->dev, oper_id));
return ESP_OK;

View File

@ -485,7 +485,7 @@ Dead-time specific configuration is listed in the :cpp:type:`mcpwm_dead_time_con
// NOTE: This is invalid, you can't apply the posedge delay to another generator
mcpwm_generator_set_dead_time(mcpwm_gen_b, mcpwm_gen_b, &dt_config);
However, you can apply `posedge delay` to generator A and `negedge delay` to generator B. You can also set both `posedge delay` and `negedge delay` for generator A, while letting generator B bypass the dead time module.
However, you can apply `posedge delay` to generator A and `negedge delay` to generator B. You can also set both `posedge delay` and `negedge delay` for generator B, while letting generator A bypass the dead time module. Note that if `negedge delay` and `posedge delay` are both set for generator A, generator B will not be available. Where generator A is the first generator requested through the operator handle and generator B is the second generator requested through an operator handle.
.. note::