Set the default status for an input pin to PullUp instead of letting it be PullDown.

pull/1091/head
Steven Cooreman 2015-05-04 13:27:02 -05:00
parent e4c2386911
commit 0cc42db36d
1 changed files with 6 additions and 0 deletions

View File

@ -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