Skip to content

Commit

Permalink
Add API reset to reset_pin_number
Browse files Browse the repository at this point in the history
  • Loading branch information
hierophect committed Nov 3, 2020
1 parent 05d663b commit 472a5a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ports/esp32s2/common-hal/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void reset_pin_number(gpio_num_t pin_number) {
never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32);
in_use[pin_number / 32] &= ~(1 << pin_number % 32);

gpio_reset_pin(pin_number);

#ifdef MICROPY_HW_NEOPIXEL
if (pin_number == MICROPY_HW_NEOPIXEL->number) {
neopixel_in_use = false;
Expand All @@ -83,9 +85,7 @@ void reset_all_pins(void) {
(never_reset_pins[i / 32] & (1 << i % 32)) != 0) {
continue;
}
gpio_set_direction(i, GPIO_MODE_DEF_INPUT);
gpio_pullup_dis(i);
gpio_pulldown_dis(i);
gpio_reset_pin(i);
}
in_use[0] = 0;
in_use[1] = 0;
Expand Down

0 comments on commit 472a5a9

Please sign in to comment.