= 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