add pins to spec
[mTask.git] / mTaskInterpret.icl
index f55c70d..7917c93 100644 (file)
@@ -160,11 +160,13 @@ instance fromByteCode MTaskInterval
                = OnInterrupt $ fromByteCode s bitand 127
 instance fromByteCode MTaskDeviceSpec where
        fromByteCode s = let c = toInt s.[0] in
-               {MTaskDeviceSpec
-               |haveLed=(c bitand 1) > 0
-               ,haveAio=(c bitand 2) > 0
-               ,haveDio=(c bitand 4) > 0
-               ,bytesMemory=from16bit $ s % (1,3)
+               { MTaskDeviceSpec
+               | haveLed     = (c bitand 1) > 0
+               , haveAio     = (c bitand 2) > 0
+               , haveDio     = (c bitand 4) > 0
+               , aPins       = toInt s.[3]
+               , dPins       = toInt s.[4]
+               , bytesMemory = from16bit $ s % (1,3)
                }
 
 derive gPrint Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin, BC, MTaskDeviceSpec