mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/mcpwm_fault_trigger_test' into 'master'
fix(mcpwm): fault trigger test forget connect timer and operator See merge request espressif/esp-idf!27001
This commit is contained in:
commit
1677bfa0a3
@ -769,6 +769,15 @@ TEST_CASE("mcpwm_generator_action_on_fault_trigger_event", "[mcpwm]")
|
||||
const int generator_gpio = 0;
|
||||
const int fault_gpio_num[3] = {2, 4, 5};
|
||||
printf("create timer and operator\r\n");
|
||||
mcpwm_timer_config_t timer_config = {
|
||||
.group_id = 0,
|
||||
.clk_src = MCPWM_TIMER_CLK_SRC_DEFAULT,
|
||||
.resolution_hz = 1000000,
|
||||
.count_mode = MCPWM_TIMER_COUNT_MODE_UP,
|
||||
.period_ticks = 1000,
|
||||
};
|
||||
mcpwm_timer_handle_t timer = NULL;
|
||||
TEST_ESP_OK(mcpwm_new_timer(&timer_config, &timer));
|
||||
|
||||
mcpwm_operator_config_t oper_config = {
|
||||
.group_id = 0,
|
||||
@ -776,6 +785,9 @@ TEST_CASE("mcpwm_generator_action_on_fault_trigger_event", "[mcpwm]")
|
||||
mcpwm_oper_handle_t oper = NULL;
|
||||
TEST_ESP_OK(mcpwm_new_operator(&oper_config, &oper));
|
||||
|
||||
printf("connect timer and operator\r\n");
|
||||
TEST_ESP_OK(mcpwm_operator_connect_timer(oper, timer));
|
||||
|
||||
printf("install gpio faults trigger\r\n");
|
||||
mcpwm_fault_handle_t gpio_faults[3];
|
||||
mcpwm_gpio_fault_config_t gpio_trigger_config = {
|
||||
@ -825,6 +837,7 @@ TEST_CASE("mcpwm_generator_action_on_fault_trigger_event", "[mcpwm]")
|
||||
TEST_ESP_OK(mcpwm_del_fault(gpio_faults[2]));
|
||||
TEST_ESP_OK(mcpwm_del_generator(gen));
|
||||
TEST_ESP_OK(mcpwm_del_operator(oper));
|
||||
TEST_ESP_OK(mcpwm_del_timer(timer));
|
||||
}
|
||||
|
||||
TEST_CASE("mcpwm_generator_action_on_soft_sync_trigger_event", "[mcpwm]")
|
||||
|
Loading…
Reference in New Issue
Block a user