Skip to content

Commit 69734ed

Browse files
committed
add INPUT_PULLDOWN support
1 parent f033fe8 commit 69734ed

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cores/esp8266/Arduino.h

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void yield(void);
4646
#define INPUT 0x0
4747
#define OUTPUT 0x1
4848
#define INPUT_PULLUP 0x2
49+
#define INPUT_PULLDOWN 0x3
4950
#define OUTPUT_OPEN_DRAIN 0x4
5051

5152
#define PI 3.1415926535897932384626433832795

cores/esp8266/core_esp8266_wiring_digital.c

+5
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ extern void __pinMode(uint8_t pin, uint8_t mode) {
8181
PIN_PULLUP_DIS(mux);
8282
} else if(mode == INPUT_PULLUP) {
8383
gpio_output_set(0, 0, 0, 1 << pin);
84+
PIN_PULLDWN_DIS(mux);
8485
PIN_PULLUP_EN(mux);
86+
} else if(mode == INPUT_PULLDOWN) {
87+
gpio_output_set(0, 0, 0, 1 << pin);
88+
PIN_PULLUP_DIS(mux);
89+
PIN_PULLDWN_EN(mux);
8590
} else if(mode == OUTPUT) {
8691
gpio_output_set(0, 0, 1 << pin, 0);
8792
} else if(mode == OUTPUT_OPEN_DRAIN) {

0 commit comments

Comments
 (0)