SlashDevin / NeoSWSerial

Efficient alternative to SoftwareSerial with attachInterrupt for RX chars, simultaneous RX & TX
169 stars 42 forks source link

fix: prevent RX pin from receiving garbage data #39

Open denizetkar opened 4 years ago

denizetkar commented 4 years ago

In some use cases of NeoSWSerial, the RX pin might be "disconnected/open drain" for some reason or another. In such a case, RX pin can switch on and off randomly therefore causing random pieces of data to be received. The solution I propose is simple: set mode of RX pin as INPUT_PULLUP instead of just INPUT so that whenever this pin becomes open drain, the state of this pin will be interpreted as idle (not receiving any data).