Skip to content

Commit 9b28fc3

Browse files
Free PIO SM on SerialPIO::end (#949)
Fixes #945
1 parent 6bbaf64 commit 9b28fc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cores/rp2040/SerialPIO.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,11 @@ void SerialPIO::end() {
259259
}
260260
if (_tx != NOPIN) {
261261
pio_sm_set_enabled(_txPIO, _txSM, false);
262+
pio_sm_unclaim(_txPIO, _txSM);
262263
}
263264
if (_rx != NOPIN) {
264265
pio_sm_set_enabled(_rxPIO, _rxSM, false);
266+
pio_sm_unclaim(_rxPIO, _rxSM);
265267
_pioSP[pio_get_index(_rxPIO)][_rxSM] = nullptr;
266268
// If no more active, disable the IRQ
267269
auto pioNum = pio_get_index(_rxPIO);

0 commit comments

Comments
 (0)