From: Mart Lubbers Date: Mon, 6 Mar 2017 18:48:38 +0000 (+0100) Subject: merge X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=5019b4f7dbeda8679421ec482f40b85eec9ebd72;p=mTask.git merge --- 5019b4f7dbeda8679421ec482f40b85eec9ebd72 diff --cc CleanSerial index 8a5d422,bfa6a41..ef64133 --- a/CleanSerial +++ b/CleanSerial @@@ -1,1 -1,1 +1,1 @@@ - Subproject commit 8a5d42279e8067d9dee26d5fae466deea27c6805 -Subproject commit bfa6a41e5ecfb2e11e9e389b6bb6720fda7f1ebb ++Subproject commit ef6413393c66231637cc89c252c28e866a46f14b diff --cc Devices/mTaskDevice.dcl index 1662cbb,f254a22..c489d01 --- a/Devices/mTaskDevice.dcl +++ b/Devices/mTaskDevice.dcl @@@ -32,9 -36,10 +34,11 @@@ instance == MTaskDevic class MTaskDuplex a where synFun :: a (Shared Channels) -> Task () + startupDevices :: Task [MTaskDevice] + connectDevice :: (MTaskDevice (Shared Channels) -> Task ()) MTaskDevice -> Task () manageDevices :: (MTaskDevice (Shared Channels) -> Task ()) [MTaskDevice] -> Task () sendToDevice :: String (Main (ByteCode () Stmt)) (MTaskDevice, MTaskInterval) -> Task () +sendMessages :: [MTaskMSGSend] -> (MTaskDevice -> Task Channels) deviceTaskDelete :: MTaskDevice MTaskTask -> Task () deviceTaskAcked :: MTaskDevice Int -> Task () diff --cc Devices/mTaskDevice.icl index 928432b,58dd5ed..b3f3e85 --- a/Devices/mTaskDevice.icl +++ b/Devices/mTaskDevice.icl @@@ -24,6 -24,13 +25,10 @@@ derive consName MTaskResource, TTYSetti instance == MTaskDevice where (==) a b = a.deviceChannels == b.deviceChannels -channels :: MTaskDevice -> Shared Channels -channels d = memoryShare d.deviceChannels ([], [], False) - + startupDevices :: Task [MTaskDevice] + startupDevices = upd (map reset) deviceStore + where reset d = {d & deviceTask=Nothing, deviceTasks=[], deviceError=Nothing} + makeDevice :: String MTaskResource -> Task MTaskDevice makeDevice name res = get randomInt @ \rand->{MTaskDevice |deviceChannels=name +++ toString rand