From fb60efd5926d43168f11add433c687202ba2511e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Proch=C3=A1zka?= <90197375+P-R-O-C-H-Y@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:49:54 +0200 Subject: [PATCH] Change pinMode OUTPUT to INPUT_OUTPUT (#6602) * Change OUTPUT to INPUT_OUTPUT To match the official Arduino API. --- 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 74f58c43..ff3808e9 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 0x02 +// 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