8000 Merge pull request #4160 from gamblor21/rp2040_neopixel_pin_fix · alexbartlow/circuitpython@3c99b09 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c99b09

Browse files
authored
Merge pull request adafruit#4160 from gamblor21/rp2040_neopixel_pin_fix
RP2040 Set the neopixel pin as output after PIO use
2 parents 3a68ac8 + 386b49c commit 3c99b09

File tree

1 file changed

+5
-0
lines changed
  • ports/raspberrypi/common-hal/neopixel_write

1 file changed

+5
-0
lines changed

ports/raspberrypi/common-hal/neopixel_write/__init__.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "bindings/rp2pio/StateMachine.h"
3030
#include "common-hal/rp2pio/StateMachine.h"
3131
#include "shared-bindings/microcontroller/__init__.h"
32+
#include "shared-bindings/digitalio/DigitalInOut.h"
3233

3334
#include "supervisor/port.h"
3435

@@ -89,7 +90,11 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
8990

9091
// Use a private deinit of the state machine that doesn't reset the pin.
9192
rp2pio_statemachine_deinit(&state_machine, true);
93+
94+
// Reset the pin and release it from the PIO
9295
gpio_init(digitalinout->pin->number);
96+
common_hal_digitalio_digitalinout_switch_to_output((digitalio_digitalinout_obj_t*)digitalinout, false, DRIVE_MODE_PUSH_PULL);
97+
9398
// Update the next start.
9499
next_start_raw_ticks = port_get_raw_ticks(NULL) + 1;
95100
}

0 commit comments

Comments
 (0)
0