File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
ports/atmel-samd/common-hal/digitalio Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
4040 claim_pin (pin );
4141 self -> pin = pin ;
4242
43- gpio_set_pin_pull_mode ( pin -> pin , GPIO_PULL_OFF );
43+ // Must set pull after setting direction.
4444 gpio_set_pin_direction (pin -> pin , GPIO_DIRECTION_IN );
45+ gpio_set_pin_pull_mode (pin -> pin , GPIO_PULL_OFF );
4546 return DIGITALINOUT_OK ;
4647}
4748
@@ -154,9 +155,9 @@ void common_hal_digitalio_digitalinout_set_pull(
154155 default :
155156 break ;
156157 }
157- // Set pull first to avoid glitches.
158- gpio_set_pin_pull_mode (self -> pin -> pin , asf_pull );
158+ // Must set pull after setting direction.
159159 gpio_set_pin_direction (self -> pin -> pin , GPIO_DIRECTION_IN );
160+ gpio_set_pin_pull_mode (self -> pin -> pin , asf_pull );
160161}
161162
162163digitalio_pull_t common_hal_digitalio_digitalinout_get_pull (
You can’t perform that action at this time.
0 commit comments