Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mart Lubbers
CleanSerial
Commits
c085f39f
Commit
c085f39f
authored
May 01, 2018
by
Mart Lubbers
Browse files
updates
parent
2c920646
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
c085f39f
...
...
@@ -7,7 +7,7 @@ DETECTED_OS=POSIX
endif
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
mkdir
-p
Clean
\
System
\
Files
...
...
POSIX/Platform.dcl
View file @
c085f39f
definition
module
Platform
getDevices
::
!*
World
->
!
*([
String
],
!*
World
)
getDevices
::
!*
World
->
*([
String
],
!*
World
)
POSIX/Platform.icl
View file @
c085f39f
...
...
@@ -4,7 +4,7 @@ import Data.Error
import
StdMisc
,
StdOverloaded
,
StdString
import
System
.
Directory
getDevices
::
!*
World
->
!
*([
String
],
!*
World
)
getDevices
::
!*
World
->
*([
String
],
!*
World
)
getDevices
w
=
case
readDirectory
"/dev"
w
of
(
Error
(
errcode
,
errmsg
),
w
)
=
abort
errmsg
(
Ok
entries
,
w
)
=
(
entries
,
w
)
iTasksTTY.dcl
View file @
c085f39f
...
...
@@ -5,6 +5,4 @@ import iTasks
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
iTasksTTY.icl
View file @
c085f39f
...
...
@@ -30,22 +30,6 @@ import iTasks.Internal.TaskEval
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
dp
iw
=:{
resources
}
#
(
mt
,
resources
)
=
getTTYResource`
resources
...
...
@@ -128,7 +112,9 @@ serialDeviceBackgroundTask dp enc dec accShare rw iworld
(
Left
err
,
newacc
)
=
(
Error
(
exception
"Error while parsing"
),
iworld
)
(
Right
msgs
,
newacc
)
#
(
merr
,
iworld
)
=
if
(
msgs
=:
[])
(
Ok
(),
iworld
)
if
(
s
=:
[])
(
Ok
(),
iworld
)
(
write
(
r
,
[],
False
)
rw
iworld
)
(
write
(
r
++
msgs
,
[],
False
)
rw
iworld
)
|
isError
merr
=
(
liftError
merr
,
iworld
)
=
write
newacc
accShare
iworld
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment