CLM:=clm
override CLMFLAGS+=-dynamics -h 200M -nt -l -no-pie
CLMLIBS:=\
- -I ./iTasks-SDK/Patches/Dynamics\
- -I ./iTasks-SDK/Patches/Generics\
- -I ./iTasks-SDK/Patches/StdEnv\
- -I ./iTasks-SDK/Patches/TCPIP\
- -I ./iTasks-SDK/Server\
- -I ./clean-platform/src/libraries/OS-Independent\
- -I ./clean-platform/src/libraries/OS-Independent/Deprecated/StdLib\
- -I ./clean-platform/src/libraries/OS-Posix\
- -I ./clean-platform/src/libraries/OS-Linux\
- -I ./clean-platform/src/libraries/OS-Linux-64\
- -I ./iTasks-SDK/Dependencies/graph_copy/linux64\
- -I ./iTasks-SDK/Dependencies/graph_copy/common\
- -I ./iTasks-SDK/Dependencies/SAPL\
- -I ./iTasks-SDK/Dependencies/clean-sapl/src\
- -I ./iTasks-SDK/Server/lib\
+ -I $(CLEAN_HOME)/lib/Platform\
+ -I $(CLEAN_HOME)/lib/Platform/Deprecated/StdLib\
+ -I $(CLEAN_HOME)/lib/iTasks\
+ -I $(CLEAN_HOME)/lib/GraphCopy\
+ -I $(CLEAN_HOME)/lib/Sapl\
-I $(CLEAN_HOME)/lib/StdEnv\
-I $(CLEAN_HOME)/lib/Generics\
-I $(CLEAN_HOME)/lib/Dynamics\
*mTasks* are written in [clean][clean] and specifically using the
[iTasks][itasks] library.
-### Workings of an *mTask* system
-*mTasks* are routines that are executed in a round robin fashion
+### How to setup the iTask system
+Get the latest iTask and run Make. Make sure to have `gcc-5`.
-### Communication back to the server via shared data sources
-When a shared data source is updated the *mTask* can publish this data back to
-the server. This is usefull when for example a temperature reaches a certain
-threshhold. How this communication will be done is yet to be researched.
-**TODO**
+### How to setup the interpreter
+For the linux version install `gcc` and run `make -f Makefile.linux` in the
+`./int` directory
-### Usage
-All programs can be built by running `make`. Note that you need the latest
-`clm` version if you want to use the `Makefile` since hierarchical modules are
-used. This version can be found [here][clm].
-
-The following programs are available as of now:
-- `mTaskExamples`
-
- This compiles a list of mTask examples to `C` code.
-
-- `mTaskMakeSymbols`
-
- This creates the `mTaskSymbols.h` header file
-
-- `mTaskInterpret`
-
- This compiles a subset of *mTasks* to bytecode.
+For the STM version install `gcc-arm-none-eabi` and run `make` in the `./int`
+directory. To flash the binary to the device install (a recent version of)
+`openocd` and run `make flash` in the `./int` directory.
### Protocol
The server can send task specifications to the microcontroller by sending:
Where n is a 16bit integer.
-### Bytecode operations
-The header file for the interpreter with the corresponding bytevalues can be
-generated by running `mTaskMakeSymbols`.
-
### Author(s)
Initial work has been done by Pieter Koopman. Extensions have been made by Mart
Lubbers.
-[clm]: https://svn.cs.ru.nl/repos/clean-tools/trunk/clm
[clean]: clean.cs.ru.nl
[itasks]: clean.cs.ru.nl/ITasks
include $(RULESPATH)/rules.mk\r
\r
flash: build/$(PROJECT).bin\r
- sudo openocd \\r
+ sudo `which openocd` \\r
-f interface/stlink-v2-1.cfg\\r
-c "transport select hla_swd"\\r
-f target/stm32f7x.cfg \\r
import iTasks.API.Core.Types
import mTask
-//:: Display a = Display a
+:: Display a = Display a
-//derive class iTask Display
-//instance zero State`
+derive class iTask Display
eval :: (Main (Eval t p)) -> [String] | toString t
:: State` =
import iTasks
import gdynamic, gCons, GenEq, StdMisc, StdArray
import mTask
-//derive class iTask Display
+derive class iTask Display
eval :: (Main (Eval t p)) -> [String] | toString t
eval {main=(E f)} = [toString (fst (f Rd zero))]
from Text import class Text(startsWith,concat,split,join), instance Text String
+from Data.Func import $
import Data.Tuple
import System.Directory
>>= \p->sendMsg (fst (makeMsgs 0 (bc2 p))) ch)
||- forever (enterChoice "Choose led to disable" [] [LED1, LED2, LED3]
>>= \p->sendMsg (fst (makeMsgs 0 (bc3 p))) ch)
- ||- viewSharedInformation "channels" [ViewWith lens] ch
+ ||- viewSharedInformation "channels" [ViewAs lens] ch
||- viewSharedInformation "messages" [] messageShare
||- viewSh sdsShares ch
>>* [OnAction ActionFinish (always shutDown)]
# iworld = {iworld & world=world, resources=Just (TTYd tty)}
= case addBackgroundTask 42 (BackgroundTask (serialDeviceBackgroundTask rw)) iworld of
(Error e, iworld) = (ExceptionResult (exception "h"), iworld)
- (Ok _, iworld) = (ValueResult NoValue {TaskEvalInfo|lastEvent=ts,removedTasks=[],refreshSensitive=True} NoRep (TCBasic taskId ts JSONNull False), iworld)
+ (Ok _, iworld) = (ValueResult NoValue {TaskEvalInfo|lastEvent=ts,removedTasks=[],refreshSensitive=True} NoChange (TCBasic taskId ts JSONNull False), iworld)
eval _ _ tree=:(TCBasic _ ts _ _) iworld
- = (ValueResult NoValue {TaskEvalInfo|lastEvent=ts,removedTasks=[],refreshSensitive=False} NoRep tree, iworld)
+ = (ValueResult NoValue {TaskEvalInfo|lastEvent=ts,removedTasks=[],refreshSensitive=False} NoChange tree, iworld)
eval event evalOpts tree=:(TCDestroy _) iworld=:{IWorld|resources,world}
# (TTYd tty) = fromJust resources
(Error e, iworld) = (ExceptionResult (exception "h"), iworld)
(Ok _, iworld) = (DestroyedResult, iworld)
-serialDeviceBackgroundTask :: (Shared ([MTaskMSGRecv],[MTaskMSGSend],Bool)) !*IWorld -> *IWorld
+serialDeviceBackgroundTask :: (Shared ([MTaskMSGRecv],[MTaskMSGSend],Bool)) !*IWorld -> (MaybeError TaskException (), *IWorld)
serialDeviceBackgroundTask rw iworld
= case read rw iworld of
- (Error e, iworld) = abort "share couldn't be read"
+ (Error e, iworld) = (Error $ exception "share couldn't be read", iworld)
(Ok (r,s,ss), iworld)
# (Just (TTYd tty)) = iworld.resources
# tty = writet (map encode s) tty
= ([decode l], tty)
# iworld = {iworld & resources=Just (TTYd tty)}
= case write (r++ml,[],False) rw iworld of
- (Error e, iworld) = abort "share couldn't be written"
+ (Error e, iworld) = (Error $ exception "share couldn't be written", iworld)
(Ok _, iworld) = case notify rw iworld of
- (Error e, iworld) = abort "share couldn't be notified"
- (Ok _, iworld) = iworld
+ (Error e, iworld) = (Error $ exception "share couldn't be notified", iworld)
+ (Ok _, iworld) = (Ok (), iworld)
where
writet :: [String] -> (*TTY -> *TTY)
writet [] = id