diff --git a/components/driver/gpio.c b/components/driver/gpio.c index 1a38620dbb..3201372bc1 100644 --- a/components/driver/gpio.c +++ b/components/driver/gpio.c @@ -161,7 +161,7 @@ static esp_err_t gpio_output_enable(gpio_num_t gpio_num) esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level) { - GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG); + GPIO_CHECK(GPIO_IS_VALID_OUTPUT_GPIO(gpio_num), "GPIO output gpio_num error", ESP_ERR_INVALID_ARG); if (level) { if (gpio_num < 32) { GPIO.out_w1ts = (1 << gpio_num); diff --git a/components/driver/include/driver/gpio.h b/components/driver/include/driver/gpio.h index 83d3806834..4f2a800724 100644 --- a/components/driver/include/driver/gpio.h +++ b/components/driver/include/driver/gpio.h @@ -269,7 +269,7 @@ esp_err_t gpio_intr_disable(gpio_num_t gpio_num); * * @return * - ESP_OK Success - * - GPIO_IS_VALID_GPIO GPIO number error + * - ESP_ERR_INVALID_ARG GPIO number error * */ esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level);