Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
This question must surely have been answered somewhere in the forum but I cannot find it so I will ask it here. If one wants to add a function to the firmware on the CMM2 (it is clearly stated that this is easy to do) what are the actual steps involved?? The section that describes this on the website follows :
Adding Functionality
MMBasic has a simple mechanism for adding functionality that is both elegant and efficient. This allows the easy addition of new commands, functions and operators.
For example, let us say that you want to implement a function that returns a special value generated by your hardware.
In one file you would define the C function to perform the operation:
And in another file you insert the definition of your function into the function table. This links the function name in BASIC ("MyFunction") with the C function (fun_myfun):
{ "MyFunction", T_FNA | T_NBR, 0, fun_myfun },
MMBasic will do the rest and in your BASIC program you can use the function like any other:
PRINT MyFunction/100
This mechanism also applies to commands and even to arithmetic and string operators (ie, +, -, /, etc).