Author Topic: Suggestion: new cr/lf option  (Read 312 times)

joevt

  • Newbie
  • *
  • Posts: 1
    • View Profile
Suggestion: new cr/lf option
« on: June 17, 2016, 09:20:11 PM »
Iíve been using Serial Tools to do some kernel debugging. It works well, but thereís one feature I would like added. Currently in the Terminal view, I see some lines are double spaced, and some lines are not. This is because different routines are being used in the kernel to output lines to the serial port. One of them does only lf or cr, and the other does crlf. I would like an additional cr/lf option that treats all those combinations as cr/lf (maybe change the existing cr/lf checkbox to a popup menu to select one of the three options). It would work like this:

Code: [Select]
previousInputCharacter = '\0';

while (GetInputCharacter(&inputCharacter)) {
if (inputCharacter == cr) {
PassCharacter(cr);
PassCharacter(lf);
}
else if (inputCharacter == lf) {
if (previousInputCharacter == cr) {
// ignore lf when it is preceded by cr because we already handled that
}
else {
PassCharacter(cr);
PassCharacter(lf);
}
}
else {
PassCharacter(inputCharacter);
}
previousInputCharacter = inputCharacter;
}

This should correctly handle input that uses lf, cr, or crlf.

Another thing missing is flow control options. (xon/xoff, rts/cts, dtr/dsr)