You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand the "swap" after open-com . The stack diagram for ! is ( n address -- )
Your code has no error check of the value returned by open-com . If the return value is -1, the operation failed. I do not know whether or not that happened, from what you report.
As an alternative to "create buf 59 cells allot", it is better to allocate buffers with "59 cells buffer: buf" . That works better for code that will ultimately be compiled, because the space is dynamically allocated as needed, instead of going in the dictionary, which might be partially in read-only FLASH on some systems.
timed-read-com returns the number of bytes actually received. If the operation times out without having received any bytes, timed-read-com returns 0. You did not say what value timed-read-com returned, so I cannot tell what it did.
Not a bug but use difficulty
I wish to access the serial port on linux.
I tried this, what is wrong?
variable serid
9600 constant baudrate
create buf 59 cells allot
0 open-com serid swap !
buf 25 100 serid @ timed-read-com
The device sends a string ever second.
The text was updated successfully, but these errors were encountered: