1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

add INPUT_PULLDOWN support

This commit is contained in:
Markus Sattler 2015-04-21 19:46:23 +02:00
parent f033fe8e6e
commit 69734ed239
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,7 @@ void yield(void);
#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2
#define INPUT_PULLDOWN 0x3
#define OUTPUT_OPEN_DRAIN 0x4
#define PI 3.1415926535897932384626433832795

View File

@ -81,7 +81,12 @@ extern void __pinMode(uint8_t pin, uint8_t mode) {
PIN_PULLUP_DIS(mux);
} else if(mode == INPUT_PULLUP) {
gpio_output_set(0, 0, 0, 1 << pin);
PIN_PULLDWN_DIS(mux);
PIN_PULLUP_EN(mux);
} else if(mode == INPUT_PULLDOWN) {
gpio_output_set(0, 0, 0, 1 << pin);
PIN_PULLUP_DIS(mux);
PIN_PULLDWN_EN(mux);
} else if(mode == OUTPUT) {
gpio_output_set(0, 0, 1 << pin, 0);
} else if(mode == OUTPUT_OPEN_DRAIN) {