X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=mTaskMakeSymbols.icl;h=f92cb2ae7cbf29045326ee41c1ef511b83ce349b;hb=af388f6b2c06d38b400d482ac3ccc1f819b5bf9f;hp=bb4c33eb5b6b7d6dce011b49f446f0109ba23a92;hpb=f63e9891ef344e992a8a837cd3301ba3209f1e5c;p=mTask.git diff --git a/mTaskMakeSymbols.icl b/mTaskMakeSymbols.icl index bb4c33e..f92cb2a 100644 --- a/mTaskMakeSymbols.icl +++ b/mTaskMakeSymbols.icl @@ -18,9 +18,9 @@ from Data.Func import $ import Data.List from Text import class Text(join,toUpperCase), instance Text String -derive consIndex BC -derive consName BC -derive conses BC, AnalogPin +derive consIndex BC, Pin +derive consName BC, Pin +derive conses BC, AnalogPin, DigitalPin, Pin (<+) infixr 5 :: a b -> String | toString a & toString b (<+) a b = toString a +++ toString b @@ -31,7 +31,7 @@ toDefine i b = "#define " <+ toUpperCase (consName{|*|} b) <+ " " <+ i Start w # (io, w) = stdio w # io = io <<< "#ifndef MTASK_H\n#define MTASK_H\n" -# io = io <<< join "\n" (zipWith toDefine [1..] conses{|*|}) +# io = io <<< join "\n" (zipWith toDefine [0..] conses{|*|}) # (ok, w) = fclose (io <<< "\n#endif\n") w | not ok = abort "Couldn't close stdio" = w