small update
[mTask.git] / mTask.icl
index f0249c9..2bbcc30 100644 (file)
--- a/mTask.icl
+++ b/mTask.icl
@@ -14,8 +14,11 @@ todo:
        imporove setp: >>*.
 */
 
+import Generics.gCons
+import Generics.gdynamic
+
 import iTasks
-import gdynamic, gCons, GenEq, StdMisc, StdArray
+import GenEq, StdMisc, StdArray, GenBimap
 import mTaskCode
 import mTaskSerial, mTaskLCD
 
@@ -56,6 +59,7 @@ instance type2string Char       where type2string _ = "char"
 instance type2string MTask      where type2string _ = "task"
 instance type2string DigitalPin where type2string _ = "int"
 instance type2string AnalogPin  where type2string _ = "int"
+instance type2string UserLED    where type2string _ = "int"
 instance type2string String     where type2string _ = "Char []"
 instance type2string ()         where type2string _ = ""
 
@@ -84,7 +88,7 @@ instance typeSelector Char where typeSelector = c ".c"
 instance typeSelector Bool where typeSelector = c ".b"
 instance typeSelector a    where typeSelector = c ".w"
 
-read` :: Int (ReadWrite a) State -> (a,State) | dyn a
+read` :: Int (ReadWrite a) State` -> (a,State`) | dyn a
 read` n Rd       s = (fromJust (fromDyn (s.store !! n)), s)
 read` n (Wrt a)  s = (a,{s&store=updateAt n (toDyn a) s.store})
 read` n (Updt f) s=:{store}
@@ -117,9 +121,10 @@ instance long Eval Long where
 
 instance == DigitalPin where (==) x y = x === y
 instance == AnalogPin   where (==) x y = x === y
+instance == UserLED where (==) x y = x === y
 
-derive consName DigitalPin, AnalogPin, PinMode
-derive consIndex DigitalPin, AnalogPin
+//derive class gCons UserLED, Long, Pin, Button, UserLED, AnalogPin, DigitalPin, PinMode
+//derive class iTask UserLED, Long, Pin, Button, UserLED, AnalogPin, DigitalPin, PinMode
 
 tab =: toString (repeatn tabSize ' ')
 tabSize :== 2