8000 add INPUT_PULLDOWN support · lemio/Arduino@884b600 · GitHub
[go: up one dir, main page]

Skip to cont 8000 ent

Commit 884b600

Browse files
committed
add INPUT_PULLDOWN support
1 parent 19fccb6 commit 884b600

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

hardware/esp8266com/esp8266/cores/esp8266/Arduino.h

Lines changed: 1 addition & 0 deletions
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

hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_digital.c

Lines changed: 5 additions & 0 deletions
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)
0