8000 Merge pull request #5798 from jerryneedell/jerryn_gpio · domdfcoding/circuitpython@9a9893f · GitHub
[go: up one dir, main page]

Skip to content

Commit 9a9893f

Browse files
authored
Merge pull request adafruit#5798 from jerryneedell/jerryn_gpio
Broadcom: Set JTAG pins to Pull Down on initialization
2 parents 3459428 + 14815f6 commit 9a9893f

File tree

1 file changed

+2
-3
lines changed
  • ports/broadcom/common-hal/microcontroller

1 file changed

+2
-3
lines changed

ports/broadcom/common-hal/microcontroller/Pin.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ void reset_pin_number(uint8_t pin_number) {
4848
pin_in_use[pin_number] = false;
4949
never_reset_pin[pin_number] = false;
5050
// Reset JTAG pins back to JTAG.
51+
BP_PULL_Enum pull = BP_PULL_NONE;
5152
if (22 <= pin_number && pin_number <= 27) {
5253
gpio_set_function(pin_number, GPIO_FUNCTION_ALT4);
53-
return;
5454
} else {
5555
gpio_set_function(pin_number, GPIO_FUNCTION_INPUT);
5656
}
5757
// Set the pull to match the datasheet.
58-
BP_PULL_Enum pull = BP_PULL_NONE;
5958
if (pin_number < 9 ||
6059
(33 < pin_number && pin_number < 37) ||
6160
pin_number > 45) {
@@ -65,7 +64,7 @@ void reset_pin_number(uint8_t pin_number) {
6564
pin_number != 44 &&
6665
pin_number != 45) {
6766
// Most pins are pulled low so we only exclude the four pins that aren't
68-
// pulled at all.
67+
// pulled at all. This will also set the JTAG pins 22-27
6968
pull = BP_PULL_DOWN;
7069
}
7170
gpio_set_pull(pin_number, pull);

0 commit comments

Comments
 (0)
0