Skip to content

Commit

Permalink
Merge branch 'bugfix/mcpwm_reset_generator_gpio_v5.1' into 'release/v…
Browse files Browse the repository at this point in the history
…5.1'

fix(mcpwm): reset GPIO used by generator after delete (v5.1)

See merge request espressif/esp-idf!28832
  • Loading branch information
suda-morris committed Feb 28, 2024
2 parents bb66e97 + 8ab2edd commit 6e44d4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/driver/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ menu "Driver Configurations"
Enabling this option can improve driver performance as well.

config MCPWM_SUPPRESS_DEPRECATE_WARN
bool "Suppress leagcy driver deprecated warning"
bool "Suppress legacy driver deprecated warning"
default n
help
Wether to suppress the deprecation warnings when using legacy MCPWM driver (driver/mcpwm.h).
Expand Down
4 changes: 3 additions & 1 deletion components/driver/mcpwm/mcpwm_gen.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -118,6 +118,8 @@ esp_err_t mcpwm_del_generator(mcpwm_gen_handle_t gen)
mcpwm_group_t *group = oper->group;

ESP_LOGD(TAG, "del generator (%d,%d,%d)", group->group_id, oper->oper_id, gen->gen_id);
// reset GPIO
gpio_reset_pin(gen->gen_gpio_num);
// recycle memory resource
ESP_RETURN_ON_ERROR(mcpwm_generator_destroy(gen), TAG, "destroy generator failed");
return ESP_OK;
Expand Down

0 comments on commit 6e44d4e

Please sign in to comment.