From: Mart Lubbers Date: Mon, 23 Jan 2017 11:38:12 +0000 (+0100) Subject: werkt nite X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=385cba3194e613293fbb1b7ef092a78eb6337528;p=mTask.git werkt nite --- diff --git a/int/interface.c b/int/interface.c index 9212720..3ee568f 100644 --- a/int/interface.c +++ b/int/interface.c @@ -93,5 +93,11 @@ void pdie(char *s) void die(char *fmt, ...) { + palWriteLine(LINE_LED1, PAL_HIGH); + palWriteLine(LINE_LED2, PAL_HIGH); + palWriteLine(LINE_LED3, PAL_HIGH); + while(1){ + delay(100); + } (void)fmt; } diff --git a/int/main.c b/int/main.c index b813ab2..dc28e0b 100644 --- a/int/main.c +++ b/int/main.c @@ -61,6 +61,7 @@ void loop(void) struct task *curtask; read_message(); + write_byte('\n'); //Run tasks cyclestart = millis(); @@ -78,7 +79,6 @@ void loop(void) debug("Current task to run: %d", ct); run_task(curtask); curtask->lastrun = cyclestart; - write_byte('\n'); } } diff --git a/miTask.icl b/miTask.icl index 1274601..46c2b99 100644 --- a/miTask.icl +++ b/miTask.icl @@ -52,19 +52,20 @@ derive class iTask SerTCP mTaskTask :: (Shared ([MTaskMSGRecv],Bool,[MTaskMSGSend],Bool)) -> Task () mTaskTask ch = - (enterInformation "Choose" [] >>= \st->case st of - Serial = deviceSelectorSerial >>= \(s,set)->syncSerialChannel s set decode encode ch - TCP = deviceSelectorNetwork >>= \(p,h)->syncNetworkChannel h p "\n" decode encode ch - ) ||- - sendMsg msgs ch ||- - ( +// (enterInformation "Choose" [] >>= \st->case st of +// Serial = deviceSelectorSerial >>= \(s,set)->syncSerialChannel s set decode encode ch +// TCP = deviceSelectorNetwork >>= \(p,h)->syncNetworkChannel h p "\n" decode encode ch +// ) ||- + deviceSelectorNetwork >>= \(p,h)->syncNetworkChannel h p "\n" decode encode ch ||- +// deviceSelectorSerial >>= \(s,set)->syncSerialChannel s set decode encode ch ||- + (sendMsg msgs ch >>= \_-> ( ( consumeNetworkStream (processSDSs sdsShares messageShare) ch ||- viewSharedInformation "channels" [ViewWith lens] ch ||- viewSharedInformation "messages" [] messageShare ||- viewSh sdsShares ch ) >>* [OnAction ActionFinish (always shutDown)] - ) + )) where messageShare :: Shared [String] messageShare = sharedStore "mTaskMessagesRecv" [] @@ -134,7 +135,7 @@ mTaskTask ch = makeBytecode :: Int (Main (ByteCode () Stmt)) -> ([MTaskMSGSend], [(Int, Shared Int)]) makeBytecode timeout bc # (msgs, st) = toMessages timeout (toRealByteCode (unMain bc)) -# shares = map (\(i,d)->(i, sdsFocus (s i) (memoryStore (s i) (Just (dd d))))) st.sdss +# shares = map (\(i,d)->(i, sharedStore (s i) (dd d))) st.sdss = (msgs, shares) where s i = "mTaskSDS-" +++ toString i