Re[2]: [cc65] Serial port API

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2001-11-06 19:20:21


Hello Mike,

>> gpz> sio_readbyte();              /* waits until character arrives and returns it */
>> gpz> sio_readbyte_nowait();       /* if character is waiting, returns it. otherwhise return 0 */

MM> [snip]

MM> May I suggest a return of -1 rather than 0? Returning 0 would preclude
MM> implementing binary links with NUL characters in them.

well you are right (kindof) .... but however, since the _nowait
function basically is only there to check if there is actually data
available (and the first character of a block is supposed to be != 0)
this works perfectly fine for me.

for a general purpose version i'd probably supply a "check if data
waiting" function instead and let the user do what the _nowait
function does whenever he needs it.

anyway, i guess the best i can do would be rewriting the thingy all
over and make it a "real" driver with one page send/recv buffer each
and decent interupt processing anyway (UZ would like that better
atleast, eh? ;D) ....

-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:44 CET