Commit 37ca946b authored by Matheus Andrade's avatar Matheus Andrade
Browse files

Empty the output channel after sending

Previously, it wasn't empting the output channel unless new messages were received. This caused multiple messages to be sent until some message was received.
parent 2c920646
......@@ -128,7 +128,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
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