mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 02:20:57 +02:00
fix(gpio): Avoid error message when calling reset on an input only pin.
The `gpio_reset_pin` function attempted to enable internal pullup on pins which does not have one. This change adds a guard to `gpio_reset_pin` for calling `gpio_pullup_en` - the same guard that makes `gpio_pullup_en` print the error.
This commit is contained in:
committed by
Song Ruo Jing
parent
819970f439
commit
9317ecb4ea
@@ -457,8 +457,10 @@ esp_err_t gpio_reset_pin(gpio_num_t gpio_num)
|
||||
{
|
||||
GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG);
|
||||
gpio_intr_disable(gpio_num);
|
||||
if (GPIO_IS_VALID_OUTPUT_GPIO(gpio_num)) {
|
||||
// for powersave reasons, the GPIO should not be floating, select pullup
|
||||
gpio_pullup_en(gpio_num);
|
||||
}
|
||||
gpio_pulldown_dis(gpio_num);
|
||||
gpio_input_disable(gpio_num);
|
||||
gpio_output_disable(gpio_num);
|
||||
|
Reference in New Issue
Block a user