8000 Merge pull request #827 from dhalbert/3.0_pb_pins_digitalinout · godlygeek/circuitpython@51106db · GitHub
[go: up one dir, main page]

Skip to content

Commit 51106db

Browse files
authored
Merge pull request adafruit#827 from dhalbert/3.0_pb_pins_digitalinout
PBxx pins were not setting DRVSTR or reporting PULL properly
2 parents 80acef5 + 240659d commit 51106db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/atmel-samd/common-hal/digitalio/DigitalInOut.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void common_hal_digitalio_digitalinout_switch_to_output(
7272
gpio_set_pin_direction(pin, GPIO_DIRECTION_OUT);
7373

7474
// Turn on "strong" pin driving (more current available). See DRVSTR doc in datasheet.
75-
hri_port_set_PINCFG_DRVSTR_bit(PORT, (enum gpio_port)GPIO_PORT(pin), pin);
75+
hri_port_set_PINCFG_DRVSTR_bit(PORT, (enum gpio_port)GPIO_PORT(pin), GPIO_PIN(pin));
7676

7777
self->output = true;
7878
self->open_drain = drive_mode == DRIVE_MODE_OPEN_DRAIN;
@@ -158,7 +158,7 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
158158
mp_raise_AttributeError("Cannot get pull while in output mode");
159159
return PULL_NONE;
160160
} else {
161-
if (hri_port_get_PINCFG_PULLEN_bit(PORT, (enum gpio_port)GPIO_PORT(pin), pin) == 0) {
161+
if (hri_port_get_PINCFG_PULLEN_bit(PORT, (enum gpio_port)GPIO_PORT(pin), GPIO_PIN(pin)) == 0) {
162162
return PULL_NONE;
163163
} if (hri_port_get_OUT_reg(PORT, (enum gpio_port)GPIO_PORT(pin), 1U << GPIO_PIN(pin)) > 0) {
164164
return PULL_UP;

0 commit comments

Comments
 (0)
0