Commit e259a05e authored by Mart Lubbers's avatar Mart Lubbers

fix soome issues

parent 553b6622
test: test.icl TTY.icl TTY.dcl Clean\ System\ Files/ctty.o
clm $(basename $<) -o $@
clm -dynamics -l -no-pie -I /opt/clean/lib/Dynamics $(basename $<) -o $@
Clean\ System\ Files/ctty.o: tty.c
gcc -c $< -o "$@"
gcc-5 -c $< -o "$@"
clean:
$(RM) -r Clean\ System\ Files/* test
......@@ -25,4 +25,4 @@ TTYerror :: !*env -> (!String, !*env)
TTYopen :: !String !TTYSettings !*env -> (!Bool,!*TTY,!*env)
TTYreadline :: !*TTY -> (!String, !*TTY)
TTYavailable :: !*TTY -> (!Bool, !*TTY)
TTYwrite :: !*TTY !String -> *TTY
TTYwrite :: !String !*TTY -> *TTY
......@@ -55,9 +55,9 @@ TTYreadline _ = code {
ccall ttyreadline "I:VSI"
}
TTYwrite :: !*TTY !String -> *TTY
TTYwrite :: !String !*TTY -> *TTY
TTYwrite _ _ = code {
ccall ttywrite "IS:I"
ccall ttywrite "SI:I"
}
TTYavailable :: !*TTY -> (!Bool, !*TTY)
......
......@@ -16,7 +16,7 @@ Start w
# (io, w) = stdio w
# (ok, tty, w) = TTYopen "/dev/ttyUSB0" zero w
| not ok = TTYerrorclose io w
#! tty = TTYwrite tty "echo123\n"
#! tty = TTYwrite "echo123\n" tty
#! (av, tty) = TTYavailable tty
# io = io <<< ("Bytes available: " +++ toString av +++ "\n")
#! (l, tty) = TTYreadline tty
......
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
......@@ -203,7 +204,7 @@ void ttyreadline(int fd, CleanString *result, int *fdo)
void ttyavailable(int fd, int *r, int *fdo)
{
debug("ttyavailable");
// debug("ttyavailable");
fd_set fds;
struct timeval tv;
tv.tv_sec = 0;
......@@ -216,10 +217,10 @@ void ttyavailable(int fd, int *r, int *fdo)
if(*r == -1)
die("select");
*fdo = fd;
debug("ttyavailable-done");
// debug("ttyavailable-done");
}
int ttywrite(int fd, CleanString s)
int ttywrite(CleanString s, int fd)
{
debug("ttywrite");
write(fd, CleanStringCharacters(s), CleanStringLength(s));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment