diff --git a/unix/serial.fs b/unix/serial.fs index 27960e6..4ae1611 100644 --- a/unix/serial.fs +++ b/unix/serial.fs @@ -16,6 +16,7 @@ c-library serial c-function fdopen fdopen n a -- a ( fd mode -- file ) c-function read read n a n -- n ( fd addr u -- u' ) c-function write write n a n -- n ( fd addr u -- u' ) + c-function close close n -- n ( fd -- r ) end-c-library [IFDEF] android @@ -84,6 +85,8 @@ base @ 8 base ! 000000010017 Constant CBAUD 000000000001 Constant IGNBRK 000000000004 Constant IGNPAR +000000000400 Constant NOCTTY +000000004000 Constant NODELAY base ! 5 Constant VTIME @@ -102,7 +105,7 @@ $541B Constant FIONREAD r> 0 t_buf tcsetattr drop ; : reset-baud ( fd -- ) - t_old 0 rot tcsetattr drop ; + 0 t_old tcsetattr drop ; : check-read ( fd -- n ) >r 0 sp@ r> fileno FIONREAD rot ioctl drop ;