Shop OBEX P1 Docs P2 Docs Learn Events
Full-Duplex Serial Driver v1.1 — Parallax Forums

Full-Duplex Serial Driver v1.1

ErNaErNa Posts: 1,751
edited 2007-10-23 12:03 in Propeller 1
The following problem:

rxcheck returns -1 if input buffer is empty and $00..$FF if not. But -1 is represented by $FF, being a byte.

Doesn't that mean to limit data range to $00..$7F?

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-10-23 07:40
    No, a return value is ALWAYS a LONG. Check BEFORE moving it into a byte variable.
  • ErNaErNa Posts: 1,751
    edited 2007-10-23 11:01
    Anyway, it is confusing. A long with name rxbyte ?

    The comment should be changed from "returns -1 if no byte received, $00..$FF if byte"
    to "returns -1 if no byte received, $00000000..$000000FF if byte" to ommit this confusion.

    That would clearify, that the long is a container for the byte.

    Post Edited (ErNa) : 10/23/2007 12:27:58 PM GMT
  • JavalinJavalin Posts: 892
    edited 2007-10-23 12:03
    No not really - rxbyte is a recieved byte - i.e. from the serial object. its the name of what it contains rather than what it is!

    J
Sign In or Register to comment.