Commit c085f39f authored by Mart Lubbers's avatar Mart Lubbers
Browse files

updates

parent 2c920646
...@@ -7,7 +7,7 @@ DETECTED_OS=POSIX ...@@ -7,7 +7,7 @@ DETECTED_OS=POSIX
endif endif
test: test.icl TTY.icl TTY.dcl Clean\ System\ Files/ctty.o test: test.icl TTY.icl TTY.dcl Clean\ System\ Files/ctty.o
clm -dynamics -I $(DETECTED_OS) -I $(CLEAN_HOME)/lib/Dynamics $(basename $<) -o $@ clm -dynamics -I $(DETECTED_OS) -I $(CLEAN_HOME)/lib/Platform -I $(CLEAN_HOME)/lib/Dynamics $(basename $<) -o $@
Clean\ System\ Files/ctty.o: $(DETECTED_OS)/tty.c Clean\ System\ Files/ctty.o: $(DETECTED_OS)/tty.c
mkdir -p Clean\ System\ Files mkdir -p Clean\ System\ Files
......
definition module Platform definition module Platform
getDevices :: !*World -> !*([String], !*World) getDevices :: !*World -> *([String], !*World)
...@@ -4,7 +4,7 @@ import Data.Error ...@@ -4,7 +4,7 @@ import Data.Error
import StdMisc, StdOverloaded, StdString import StdMisc, StdOverloaded, StdString
import System.Directory import System.Directory
getDevices :: !*World -> !*([String], !*World) getDevices :: !*World -> *([String], !*World)
getDevices w = case readDirectory "/dev" w of getDevices w = case readDirectory "/dev" w of
(Error (errcode, errmsg), w) = abort errmsg (Error (errcode, errmsg), w) = abort errmsg
(Ok entries, w) = (entries, w) (Ok entries, w) = (entries, w)
...@@ -5,6 +5,4 @@ import iTasks ...@@ -5,6 +5,4 @@ import iTasks
derive class iTask TTYSettings derive class iTask TTYSettings
enterTTYSettings :: Task TTYSettings
syncSerialChannel :: TTYSettings (b -> String) (String -> (Either String [a], String)) (Shared ([a],[b],Bool)) -> Task () | iTask a & iTask b syncSerialChannel :: TTYSettings (b -> String) (String -> (Either String [a], String)) (Shared ([a],[b],Bool)) -> Task () | iTask a & iTask b
...@@ -30,22 +30,6 @@ import iTasks.Internal.TaskEval ...@@ -30,22 +30,6 @@ import iTasks.Internal.TaskEval
derive class iTask TTYSettings, Parity, BaudRate, ByteSize derive class iTask TTYSettings, Parity, BaudRate, ByteSize
enterTTYSettings :: Task TTYSettings
enterTTYSettings = accWorld getTTYDevices
>>= \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
getTTYResource :: String *IWorld -> (Maybe *(*TTY, Int), *IWorld) getTTYResource :: String *IWorld -> (Maybe *(*TTY, Int), *IWorld)
getTTYResource dp iw=:{resources} getTTYResource dp iw=:{resources}
# (mt, resources) = getTTYResource` resources # (mt, resources) = getTTYResource` resources
...@@ -128,7 +112,9 @@ serialDeviceBackgroundTask dp enc dec accShare rw iworld ...@@ -128,7 +112,9 @@ serialDeviceBackgroundTask dp enc dec accShare rw iworld
(Left err, newacc) = (Error (exception "Error while parsing"), iworld) (Left err, newacc) = (Error (exception "Error while parsing"), iworld)
(Right msgs, newacc) (Right msgs, newacc)
# (merr, iworld) = if (msgs =: []) # (merr, iworld) = if (msgs =: [])
if (s =: [])
(Ok (), iworld) (Ok (), iworld)
(write (r, [], False) rw iworld)
(write (r++msgs, [], False) rw iworld) (write (r++msgs, [], False) rw iworld)
| isError merr = (liftError merr, iworld) | isError merr = (liftError merr, iworld)
= write newacc accShare iworld = write newacc accShare iworld
......
Supports Markdown
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