SlashDevin / NeoSWSerial

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

Added explicit TX port and mask selection on write operation. #48

Open Vasil-Pahomov opened 3 years ago

Vasil-Pahomov commented 3 years ago

The case as follows: two instances of NeoSWSerial are engaged. The first works in "listen-only" mode, while the second uses request-reply operation. After calling .listen() on first instance, the second instance does not transmit any data. The problem is that txPort and txBitMask are static variables shared across instances, and in write() function they are not assigned and used from previous call to another port instance. So transmission happen to wrong port. May be the cause of issue https://github.com/SlashDevin/NeoSWSerial/issues/33