gpio driver: Fix gpio_set_level validation of gpio_num argument

Closes #125 https://github.com/espressif/esp-idf/issues/125
This commit is contained in:
Angus Gratton 2016-12-22 13:05:19 +11:00
parent 1e44f72e98
commit ff1fa8a323
2 changed files with 2 additions and 2 deletions

View file

@ -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) 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 (level) {
if (gpio_num < 32) { if (gpio_num < 32) {
GPIO.out_w1ts = (1 << gpio_num); GPIO.out_w1ts = (1 << gpio_num);

View file

@ -269,7 +269,7 @@ esp_err_t gpio_intr_disable(gpio_num_t gpio_num);
* *
* @return * @return
* - ESP_OK Success * - 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); esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level);