X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTask.dcl;h=ac9405c0544dc3c916dece2b63203c7e373a3961;hb=acd239b3f29e215ade0b63d5b26b6cf8e8ae0d63;hp=d341ff79160fc8ce5ba5b9273b68899be9cc6b9c;hpb=e25fda18ca554ec3fe937152403872b916367ddb;p=mTask.git diff --git a/mTask.dcl b/mTask.dcl index d341ff7..ac9405c 100644 --- a/mTask.dcl +++ b/mTask.dcl @@ -14,14 +14,17 @@ todo: imporove setp: >>*. */ -//import iTasks +import Generics.gCons +import Generics.gdynamic + +import iTasks + import iTasks._Framework.Generic -import iTasks._Framework.Task +from iTasks._Framework.Task import :: Task import StdClass -from iTasks.API.Core.Types import :: Display -import gdynamic, gCons, GenEq, StdMisc, StdArray +import GenEq, StdMisc, StdArray -import mTaskCode, mTaskSimulation +import mTaskCode, mTaskSimulation, mTaskInterpret import mTaskSerial, mTaskLCD // =================== mTask =================== @@ -32,6 +35,7 @@ import mTaskSerial, mTaskLCD :: DigitalPin = D0 | D1 | D2 | D3 | D4 | D5 |D6 | D7 | D8 | D9 | D10 | D11 | D12 | D13 :: AnalogPin = A0 | A1 | A2 | A3 | A4 | A5 +:: UserLED = LED1 | LED2 | LED3 :: PinMode = INPUT | OUTPUT | INPUT_PULLUP :: Pin = Digital DigitalPin | Analog AnalogPin @@ -61,7 +65,7 @@ instance == MTask unMain :: (Main x) -> x class arith v where - lit :: t -> v t Expr | toCode t + lit :: t -> v t Expr | toCode t & toByteCode t (+.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, +, zero t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q (-.) infixl 6 :: (v t p) (v t q) -> v t Expr | type, -, zero t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q (*.) infixl 7 :: (v t p) (v t q) -> v t Expr | type, *, zero, one t & isExpr p & isExpr q //& toExpr2 p & toExpr2 q @@ -86,8 +90,9 @@ class var2 v where var2 :: t ((v t Upd)->(Main (v c s))) -> (Main (v c s)) | type, toCode t con2 :: t ((v t Expr) ->(Main (v c s))) -> (Main (v c s)) | type t class sds v where - sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, toCode t + sds :: ((v t Upd)->In t (Main (v c s))) -> (Main (v c s)) | type, toByteCode, toCode t con :: ((v t Expr) ->In t (Main (v c s))) -> (Main (v c s)) | type t + pub :: (v t Upd) -> v t Expr | type t class seq v where (>>=.) infixr 0 :: (v t p) ((v t Expr) -> (v u q)) -> (v u Stmt) | type t & type u (:.) infixr 0 :: (v t p) (v u q) -> v u Stmt | type t & type u @@ -126,6 +131,10 @@ class time v where delay :: (v Long p) -> (v Long Expr) millis :: (v Long Expr) +class userLed v where + ledOn :: UserLED -> (v () Stmt) + ledOff :: UserLED -> (v () Stmt) + class pio p t where pio :: p -> v t Upd | aIO v & dIO v instance pio AnalogPin Int instance pio AnalogPin Bool @@ -182,7 +191,7 @@ instance typeSelector a :: In a b = In infix 0 a b -read` :: Int (ReadWrite a) State -> (a,State) | dyn a +read` :: Int (ReadWrite a) State` -> (a,State`) | dyn a // ----- long ----- //