arthurwolf/Smoothie — pull request #99 by orcinus (2013-02-10 18:29:08+00:00)
Title: SerialConsole should now tolerate all line terminators (CR, LF, CR+LF, LF+CR)

Okay, attempt two.

Turns out the reason anything but LF was creating problems was that line termination was actually handled in two places at the same time. Once in USBSerial, then again in SerialConsole. On top of that, there were two circular buffers doing the same thing and two on_main_loop handlers, both triggering ON_CONSOLE_LINE_RECEIVED.

I've added \r handling to USBSerial and removed everything but the interrupt handler from SerialConsole. All terminators work now, from all the terminal emulators i've tried and they work reliably.

I've also tried printing from Pronterface (and playing a gcode file from the card, just in case) and that works as well, so nothing seems to be broken.

The only thing still not working is Repetier Host which, for some unknown reason, still tends to crash Smoothie after a few lines (it did that before my meddling as well, i was hoping it's related to newline handling, but it isn't). I'll continue trying to figure that one out...