Commit 1b85b495 authored by Mart Lubbers's avatar Mart Lubbers

update remove debug

parent 1b51061d
......@@ -12,9 +12,9 @@ endif
Clean\ System\ Files/ctty.o: tty.c
mkdir -p Clean\ System\ Files
ifeq "$(GCCVERSIONGTEQ6)" "1"
gcc-5 -DDEBUG -c $< -o "$@"
gcc-5 -c $< -o "$@"
else
gcc -DDEBUG -c $< -o "$@"
gcc -c $< -o "$@"
endif
clean:
......
......@@ -32,17 +32,23 @@ getTTYDevices w = case readDirectory "/dev" w of
(Ok entries, w) = (map ((+++) "/dev/") (filter isTTY entries), w)
where
isTTY s = not (isEmpty (filter (flip startsWith s) prefixes))
prefixes = ["ttyS", "ttyACM", "ttyUSB", "tty.usbserial"]
prefixes = ["ttyS", "ttyACM", "ttyUSB", "tty.usbserial", "rfcomm"]
enterTTYSettings :: Task TTYSettings
enterTTYSettings = accWorld getTTYDevices
>>= \ds->(((((enterChoice "Device" [] ds
-&&- updateInformation "Baudrate" [] B9600)
-&&- updateInformation "Bytesize" [] BytesizeEight)
-&&- updateInformation "Parity" [] ParityNone)
-&&- updateInformation "Stop2bits" [] False)
-&&- updateInformation "Xonoff" [] False)
@ (uncurry o uncurry o uncurry o uncurry o uncurry) makeTTYSettings
>>= \ds->(
enterChoice "Device" [] ds
-&&- updateInformation "Baudrate" [] B9600
<<@ ArrangeHorizontal)
-&&- (
updateInformation "Bytesize" [] BytesizeEight
-&&- updateInformation "Parity" [] ParityNone
<<@ ArrangeHorizontal)
-&&- (
updateInformation "Stop2bits" [] False
-&&- updateInformation "Xonoff" [] False
<<@ ArrangeHorizontal)
@ \((dev, br), ((bs, pr), (st, xo)))->makeTTYSettings dev br bs pr st xo
syncSerialChannel :: TTYSettings (b -> String) (String -> a) (Shared ([a],[b],Bool)) -> Task () | iTask a & iTask b
syncSerialChannel opts enc dec rw = Task eval
......@@ -80,16 +86,10 @@ serialDeviceBackgroundTask enc dec rw iworld
(Ok (r,s,ss), iworld)
# (Just (TTYd tty bgid)) = iworld.resources
# tty = writet (map enc s) tty
# tty = foldr TTYwrite tty $ map enc s
# (ml, tty) = case TTYavailable tty of
(False, tty) = ([], tty)
(_, tty) = appFst (pure o dec) $ TTYreadline tty
# iworld = {iworld & resources=Just (TTYd tty bgid)}
| isEmpty ml && isEmpty s = (Ok (), iworld)
= case write (r++ml,[],False) rw iworld of
(Error e, iworld) = (Error $ exception "share couldn't be written", iworld)
(Ok _, iworld) = (Ok (), iworld)
where
writet :: [String] -> (*TTY -> *TTY)
writet [] = id
writet [x:xs] = writet xs o TTYwrite x
= write (r++ml,[],False) rw iworld
......@@ -182,7 +182,6 @@ void ttyread(int fd, int *ch, int *fdo)
if(read(fd, &c, 1) == -1){
die("read");
}
printf("read: %o\n", c);
*ch = (int)c;
*fdo = fd;
debug("ttyread done");
......
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