8000 must set pull after setting direction with gpio_set_pin routines by dhalbert · Pull Request #1006 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

must set pull after setting direction with gpio_set_pin routines #1006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
claim_pin(pin);
self->pin = pin;

gpio_set_pin_pull_mode(pin->pin, GPIO_PULL_OFF);
// Must set pull after setting direction.
gpio_set_pin_direction(pin->pin, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(pin->pin, GPIO_PULL_OFF);
return DIGITALINOUT_OK;
}

Expand Down Expand Up @@ -154,9 +155,9 @@ void common_hal_digitalio_digitalinout_set_pull(
default:
break;
}
// Set pull first to avoid glitches.
gpio_set_pin_pull_mode(self->pin->pin, asf_pull);
// Must set pull after setting direction.
4BFE gpio_set_pin_direction(self->pin->pin, GPIO_DIRECTION_IN);
gpio_set_pin_pull_mode(self->pin->pin, asf_pull);
}

digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
Expand Down
0