Skip to content

Commit 0cc42db

Browse files
committed
Set the default status for an input pin to PullUp instead of letting it be PullDown.
1 parent e4c2386 commit 0cc42db

File tree

1 file changed

+6
-0
lines changed
  • libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32

1 file changed

+6
-0
lines changed

libraries/mbed/targets/hal/TARGET_Silicon_Labs/TARGET_EFM32/gpio_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ void gpio_mode(gpio_t *obj, PinMode mode)
5858
{
5959
obj->mode = mode; // Update object
6060
pin_mode(obj->pin, mode); // Update register
61+
62+
//Handle pullup for input
63+
if(mode == InputPullUp) {
64+
//Set DOUT
65+
GPIO->P[obj->port & 0xF].DOUTSET = 1 << (obj->pin & 0xF);
66+
}
6167
}
6268

6369
// Used by DigitalInOut to set correct mode when direction is set

0 commit comments

Comments
 (0)