I just upgraded straight from TD 1.42 to 1.46 on Arduino IDE 1.8.9. Uploading code that was unchanged since 08/18 using this new version caused my Teensy 3.2 to hang. After considerable commenting and re-uploading I found it turned out to be caused entirely by Serial1.end(). I use this to allow the baud rate to be changed programmatically. To summarise some simple tests:
Calling Serial1.end() before Serial1.begin(xxx) has ever been called causes the Teensy 3.2 to hang.
Calling Serial1.end() after Serial1.begin(xxx) has been called does not cause a hang BUT causes the first packet of data read out of Serial1 to be garbled.
These issues never occurred with TD 1.42. Question is, what additional checks do I need to put in my code to prevent these new problems? Presumably a bug in Serial1 was fixed between versions, and I was just getting away with doing this.
Do I even need to call Serial1.end() if I am only changing the baud rate on-the-fly? can I just call Serial1.begin(xxx) again?
Thanks!
Calling Serial1.end() before Serial1.begin(xxx) has ever been called causes the Teensy 3.2 to hang.
Calling Serial1.end() after Serial1.begin(xxx) has been called does not cause a hang BUT causes the first packet of data read out of Serial1 to be garbled.
These issues never occurred with TD 1.42. Question is, what additional checks do I need to put in my code to prevent these new problems? Presumably a bug in Serial1 was fixed between versions, and I was just getting away with doing this.
Do I even need to call Serial1.end() if I am only changing the baud rate on-the-fly? can I just call Serial1.begin(xxx) again?
Thanks!