]> granicus.if.org Git - esp-idf/commitdiff
Bugfix GPIO_DIS_OUTPUT to work with pin 32 and up
authorFredrik <fredrik.fornstad@gmail.com>
Sat, 31 Mar 2018 14:41:03 +0000 (16:41 +0200)
committerAngus Gratton <gus@projectgus.com>
Mon, 9 Apr 2018 02:28:23 +0000 (12:28 +1000)
Merges https://github.com/espressif/esp-idf/pull/1796

components/esp32/include/rom/gpio.h

index bd1777c60b3de3eaa42353fc68732419b8c093d7..2ce7aef6e1e5cae08b6761d82387a77c8f40c312 100644 (file)
@@ -57,8 +57,8 @@ typedef enum {
 #define GPIO_OUTPUT_SET(gpio_no, bit_value) \
         ((gpio_no < 32) ? gpio_output_set(bit_value<<gpio_no, (bit_value ? 0 : 1)<<gpio_no, 1<<gpio_no,0) : \
                          gpio_output_set_high(bit_value<<(gpio_no - 32), (bit_value ? 0 : 1)<<(gpio_no - 32), 1<<(gpio_no -32),0))
-#define GPIO_DIS_OUTPUT(gpio_no)    ((gpio_no < 32) ? gpio_output_set(0,0,0, 1<<gpio_no) : gpio_output_set_high(0,0,0, 1<<gpio_no))
-#define GPIO_INPUT_GET(gpio_no)     ((gpio_no < 32)? ((gpio_input_get()>>gpio_no)&BIT0) : ((gpio_input_get_high()>>(gpio_no - 32))&BIT0))
+#define GPIO_DIS_OUTPUT(gpio_no)    ((gpio_no < 32) ? gpio_output_set(0,0,0, 1<<gpio_no) : gpio_output_set_high(0,0,0, 1<<(gpio_no - 32)))
+#define GPIO_INPUT_GET(gpio_no)     ((gpio_no < 32) ? ((gpio_input_get()>>gpio_no)&BIT0) : ((gpio_input_get_high()>>(gpio_no - 32))&BIT0))
 
 /* GPIO interrupt handler, registered through gpio_intr_handler_register */
 typedef void (* gpio_intr_handler_fn_t)(uint32_t intr_mask, bool high, void *arg);