From 6a6cc1f54a93be0ee3bd981775c4039cb1a648fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 21 Apr 2022 12:52:01 +0200 Subject: [PATCH 1/2] Change OUTPUT to INPUT_OUTPUT To match the official Arduino API. --- cores/esp32/esp32-hal-gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-gpio.h b/cores/esp32/esp32-hal-gpio.h index 74f58c43b5a..cc2c9145cfd 100644 --- a/cores/esp32/esp32-hal-gpio.h +++ b/cores/esp32/esp32-hal-gpio.h @@ -42,7 +42,7 @@ extern "C" { //GPIO FUNCTIONS #define INPUT 0x01 -#define OUTPUT 0x02 +#define OUTPUT 0x03 //Changed from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT) where yo ucan read the state of pin even when it is set as OUTPUT #define PULLUP 0x04 #define INPUT_PULLUP 0x05 #define PULLDOWN 0x08 From 2d62b25a28286fc577423ad707f98c370db9ef24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Procha=CC=81zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:14:42 +0200 Subject: [PATCH 2/2] edited typo --- cores/esp32/esp32-hal-gpio.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/esp32/esp32-hal-gpio.h b/cores/esp32/esp32-hal-gpio.h index cc2c9145cfd..ff3808e9856 100644 --- a/cores/esp32/esp32-hal-gpio.h +++ b/cores/esp32/esp32-hal-gpio.h @@ -42,7 +42,9 @@ extern "C" { //GPIO FUNCTIONS #define INPUT 0x01 -#define OUTPUT 0x03 //Changed from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT) where yo ucan read the state of pin even when it is set as OUTPUT +// Changed OUTPUT from 0x02 to behave the same as Arduino pinMode(pin,OUTPUT) +// where you can read the state of pin even when it is set as OUTPUT +#define OUTPUT 0x03 #define PULLUP 0x04 #define INPUT_PULLUP 0x05 #define PULLDOWN 0x08