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
51fb89d3
Commit
51fb89d3
authored
Mar 17, 2017
by
Mart Lubbers
Browse files
Fix busyloop iTasks backgroundtask
parent
ef641339
Changes
1
Hide whitespace changes
Inline
Side-by-side
iTasksTTY.icl
View file @
51fb89d3
...
...
@@ -75,6 +75,8 @@ serialDeviceBackgroundTask :: (b -> String) (String -> a) (Shared ([a],[b],Bool)
serialDeviceBackgroundTask
enc
dec
rw
iworld
=
case
read
rw
iworld
of
(
Error
e
,
iworld
)
=
(
Error
$
exception
"share couldn't be read"
,
iworld
)
//We need to stop
(
Ok
(_,_,
True
),
iworld
)
=
(
Error
$
exception
"I have to stop..."
,
iworld
)
(
Ok
(
r
,
s
,
ss
),
iworld
)
#
(
Just
(
TTYd
tty
bgid
))
=
iworld
.
resources
#
tty
=
writet
(
map
enc
s
)
tty
...
...
@@ -82,13 +84,10 @@ serialDeviceBackgroundTask enc dec rw iworld
(
False
,
tty
)
=
([],
tty
)
(_,
tty
)
=
appFst
(
pure
o
dec
)
$
TTYreadline
tty
#
iworld
=
{
iworld
&
resources
=
Just
(
TTYd
tty
bgid
)}
|
isEmpty
ml
=
(
Ok
(),
iworld
)
=
case
write
(
r
++
ml
,[],
False
)
rw
iworld
of
(
Error
e
,
iworld
)
=
(
Error
$
exception
"share couldn't be written"
,
iworld
)
(
Ok
_,
iworld
)
|
isEmpty
r
=
(
Ok
(),
iworld
)
=
case
notify
rw
iworld
of
(
Error
e
,
iworld
)
=
(
Error
$
exception
"share couldn't be notified"
,
iworld
)
(
Ok
_,
iworld
)
=
(
Ok
(),
iworld
)
(
Ok
_,
iworld
)
=
(
Ok
(),
iworld
)
where
writet
::
[
String
]
->
(*
TTY
->
*
TTY
)
writet
[]
=
id
...
...
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