From: Mart Lubbers Date: Mon, 19 Jun 2017 17:36:49 +0000 (+0200) Subject: update specs X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=e19299be4b02b01fdf187418f15ddcdead25fd5a;p=mTask.git update specs --- diff --git a/client/spec.c b/client/spec.c index a6a26d3..38c58ef 100644 --- a/client/spec.c +++ b/client/spec.c @@ -7,6 +7,7 @@ void spec_send(void) write_byte('c'); write_byte(0 | (HAVELED << 0) | (HAVEAIO << 1) | (HAVEDIO << 2)); write16(MEMSIZE); + write16(STACKSIZE); write_byte(NAPINS); write_byte(NDPINS); write_byte('\n'); diff --git a/mTaskInterpret.dcl b/mTaskInterpret.dcl index c4dadfb..7e8d4b4 100644 --- a/mTaskInterpret.dcl +++ b/mTaskInterpret.dcl @@ -39,6 +39,7 @@ from Generics.gCons import class gCons, generic conses, generic consName, generi ,haveDio :: Bool ,aPins :: Int ,dPins :: Int + ,stackSize :: Int ,bytesMemory :: Int } diff --git a/mTaskInterpret.icl b/mTaskInterpret.icl index 7917c93..2d2005a 100644 --- a/mTaskInterpret.icl +++ b/mTaskInterpret.icl @@ -164,9 +164,10 @@ instance fromByteCode MTaskDeviceSpec where | 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) + , stackSize = from16bit $ s % (3,5) + , aPins = toInt s.[5] + , dPins = toInt s.[6] } derive gPrint Long, UserLED, Button, AnalogPin, DigitalPin, PinMode, Pin, BC, MTaskDeviceSpec