mirror of https://github.com/ARMmbed/mbed-os.git
Set the default status for an input pin to PullUp instead of letting it be PullDown.
parent
e4c2386911
commit
0cc42db36d
|
@ -58,6 +58,12 @@ void gpio_mode(gpio_t *obj, PinMode mode)
|
|||
{
|
||||
obj->mode = mode; // Update object
|
||||
pin_mode(obj->pin, mode); // Update register
|
||||
|
||||
//Handle pullup for input
|
||||
if(mode == InputPullUp) {
|
||||
//Set DOUT
|
||||
GPIO->P[obj->port & 0xF].DOUTSET = 1 << (obj->pin & 0xF);
|
||||
}
|
||||
}
|
||||
|
||||
// Used by DigitalInOut to set correct mode when direction is set
|
||||
|
|
Loading…
Reference in New Issue