Add assignments to pins
[mTask.git] / mTaskInterpret.icl
index df59c28..80d458a 100644 (file)
@@ -230,6 +230,12 @@ instance digitalIO ByteCode where
        digitalRead p = tell` [BCDigitalRead $ pin p]
        digitalWrite p b = op b (BCDigitalWrite $ pin p)
 
+instance aIO ByteCode where
+       aIO p = undef
+
+instance dIO ByteCode where
+       dIO p = tell` [BCDigitalRead $ pin p]
+
 instance If ByteCode Stmt Stmt Stmt where If b t e = BCIfStmt b t e
 instance If ByteCode e Stmt Stmt where If b t e = BCIfStmt b t e
 instance If ByteCode Stmt e Stmt where If b t e = BCIfStmt b t e
@@ -267,6 +273,8 @@ instance assign ByteCode where
                where 
                        //This is going to include pins as well, as variables
                        makeStore [BCSdsFetch i] = [BCSdsStore i]
+                       makeStore [BCDigitalRead i] = [BCDigitalWrite i]
+                       makeStore [BCAnalogRead i] = [BCAnalogWrite i]
 
 instance seq ByteCode where
        (>>=.) _ _ = abort "undef on >>=."