X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskInterpret.icl;h=bd5572aeb16e794af8bd9b9cdcf8650b14d96bd2;hb=59c7c761163b0cc5215563644ca60e2a47b9c9a9;hp=aeceb925b39336180882bb8905111a6d90c79aeb;hpb=feacd1b50fca9624284f8b8c22c26d7a8071515d;p=mTask.git diff --git a/mTaskInterpret.icl b/mTaskInterpret.icl index aeceb92..bd5572a 100644 --- a/mTaskInterpret.icl +++ b/mTaskInterpret.icl @@ -45,6 +45,7 @@ encode (MTTask to data) = "t" +++ toByteCode to +++ to16bit (size data) +++ data encode (MTTaskDel i) = "d" +++ to16bit i +++ "\n" encode (MTSds i v) = "s" +++ to16bit i +++ v +++ "\n" encode (MTUpd i v) = "u" +++ to16bit i +++ v +++ "\n" +encode (MTSpec) = "c\n" import StdDebug decode :: String -> MTaskMSGRecv @@ -138,7 +139,7 @@ instance fromByteCode UserLED where fromByteCode s = conses{|*|} !! toInt s.[1] instance fromByteCode BCValue where fromByteCode s = parseBCValue s.[0] s instance toByteCode MTaskInterval where - toByteCode OneShot = toByteCode 0 + toByteCode OneShot = toByteCode (OnInterval 0) //Intervals have the first bit 0 and the rest is a 15 bit unsigned int toByteCode (OnInterval i) = {toChar $ i/256 bitand 127, toChar $ i rem 256} //Intervals have the first bit 1 and the rest is a 15 bit unsigned int