Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

HardwareSerial: fix issue with swapping pins twice

Open igrr opened this issue 7 years ago • 11 comments

Previously calling HardwareSerial::swap twice would set the pins back to the original setting (1, 3). This feature was lost when swap function got an optional argument for the TX pin. This change reverts that, restoring ability to swap pins back. To use TX pin 2, HardwareSerial::pins or HardwareSerial::set_tx methods can be used.

igrr avatar May 18 '17 10:05 igrr

Ref https://github.com/esp8266/Arduino/issues/3192

igrr avatar May 18 '17 10:05 igrr

@igrr what is the status of this? Assuming it's ok'd in #3192 by the OP, can it just be merged, or is there anything pending?

devyte avatar Dec 28 '17 15:12 devyte

This was long time ago... I don't remember how thoroughly this was tested. Will revisit this and try to test all possible pin options.

igrr avatar Dec 28 '17 15:12 igrr

I've done some testing on this and there are still some issues. Will consider #3192 a known issue for 2.4.0 and work on this fix again after the release.

igrr avatar Dec 31 '17 14:12 igrr

#hwtest

igrr avatar Mar 08 '18 10:03 igrr

#hwtest

igrr avatar Mar 08 '18 11:03 igrr

@igrr what is needed to move forward on this?

devyte avatar Jul 04 '18 21:07 devyte

This doesn't fit into 2.5.0. Pushing milestone back.

devyte avatar Dec 02 '18 00:12 devyte

Thanks for your PR, but the core and libraries have changed enough that this PR now has a merge conflict.

Could you merge it manually with the latest core, so we can consider it for future releases?

earlephilhower avatar Oct 01 '19 19:10 earlephilhower

This needs work, pushing back.

devyte avatar Oct 29 '19 22:10 devyte

@devyte Regarding the issue mentioned in the title - if there's anything else to this PR beyond that, I have not looked for it and am disregarding it - it's not present in master, and this PR could be closed. I have successfully swap()ed multiple times, and used the pins() function as well, no unexpected behavior occurs.

dok-net avatar Apr 03 '21 14:04 dok-net