Shop OBEX P1 Docs P2 Docs Learn Events
propeller-load bug or feature? no line-feed character — Parallax Forums

propeller-load bug or feature? no line-feed character

DavidZemonDavidZemon Posts: 2,973
edited 2014-12-21 05:06 in Propeller 1
I would certainly classify this as a bug.... I hope it wasn't the intended execution...

PropGCC's "propeller-load -t" sends only a carriage return upon pressing enter - no line feed. I understand that the Simple library and presumably C standard library in PropGCC are okay with this... but that can't possibly be normal can it? What about when you connect to the board from any other terminal and you are using a buffered UART? Any other terminal will send perhaps just a line feed or a line feed and carriage return and - if using buffered UART - then you find yourself with a dangling line feed character in the buffer. Why don't the Prop libraries look only for line feed and propeller-load send only line-feed. Wouldn't that be more normal?

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2014-12-20 09:44
    if you are the first to notice, and the first to complain, maybe is a bug.

    if everybody else has noticed it and NOT complained, then its maybe NOT a bug.

    I use a terminal program that can be configured, each thing tends to be different from the last.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2014-12-20 09:46
    SimpleIDE doesn't use "propeller-load -t" does it? Maybe I'm one of the few actually using its built-in terminal?
  • DavidZemonDavidZemon Posts: 2,973
    edited 2014-12-20 09:48
    I use a terminal program that can be configured, each thing tends to be different from the last.

    Do you ever use C/C++ and the default serial tools (I'm pretty sure all of the standard tools use buffered UARTs)? If so, how do you have your terminal program configured?
  • jazzedjazzed Posts: 11,803
    edited 2014-12-20 10:03
    SimpleIDE doesn't use "propeller-load -t" does it? Maybe I'm one of the few actually using its built-in terminal?


    No, SimpleIDE doesn't use it.

    I'm sure David Betz uses "propeller-load -t" ....
  • David BetzDavid Betz Posts: 14,516
    edited 2014-12-20 18:25
    I would certainly classify this as a bug.... I hope it wasn't the intended execution...

    PropGCC's "propeller-load -t" sends only a carriage return upon pressing enter - no line feed. I understand that the Simple library and presumably C standard library in PropGCC are okay with this... but that can't possibly be normal can it? What about when you connect to the board from any other terminal and you are using a buffered UART? Any other terminal will send perhaps just a line feed or a line feed and carriage return and - if using buffered UART - then you find yourself with a dangling line feed character in the buffer. Why don't the Prop libraries look only for line feed and propeller-load send only line-feed. Wouldn't that be more normal?
    Yes, it is intentional. A real terminal only sends CR when you press the return key as do most terminal emulators at least by default. The C device driver translates the CR to a newline to match what C programs expect.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2014-12-20 18:54
    David Betz wrote: »
    A real terminal only sends CR when you press the return key as do most terminal emulators at least by default.

    That has to be the most unexpected thing I have ever heard to be "normal". Certainly good to know though.
  • JDatJDat Posts: 103
    edited 2014-12-20 19:17
    Just handle CR and LF correctly in your propeller code.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2014-12-20 19:19
    JDat wrote: »
    Just handle CR and LF correctly in your propeller code.

    I [essentialy] copied/pasted the code from Simple's getStr. When I first did that a few weeks ago I was thinking "this is a WEIRD way to handle CR/LF" but didn't look into it. Now I understand.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-12-21 05:06
    That has to be the most unexpected thing I have ever heard to be "normal". Certainly good to know though.
    Hardware terminals just send one code for every key pressed. They don't add LF after a CR as far as I know. And I'm old enough to have programmed lots of real terminals like VT100s and the like. :-)
Sign In or Register to comment.