mikaelpatel / Arduino-Shell

RPN Postscript/Forth Command Shell for Arduino
19 stars 5 forks source link

Enhance: Define named scripts in sketch (C++) #32

Closed mikaelpatel closed 8 years ago

mikaelpatel commented 8 years ago

It should be possible to set a variable or function from the sketch. This allows the application to define a set of scripts.

shell.set(name, value);
shell.set(name, script);
mikaelpatel commented 8 years ago

Please see commit https://github.com/mikaelpatel/Arduino-Shell/commit/e6f910e5ef395a626d02e8af9dd5c7128099c5ff, https://github.com/mikaelpatel/Arduino-Shell/commit/ebcbb009f94d36e2fe8e204f980f8a595fa902dd and https://github.com/mikaelpatel/Arduino-Shell/commit/c334928a0e105be678b2fa93b65670ea688a8f20.

dpharris commented 8 years ago

How about loading the stack before running the script?
Can I do: shell.push(0); shell.push(4); shell.execute(script0);

mikaelpatel commented 8 years ago

That has been available for a while now :).

mikaelpatel commented 8 years ago

Allow scripts from SRAM and PROGMEM to be set. Please see commit https://github.com/mikaelpatel/Arduino-Shell/commit/dfa2fc5d89ec6461a474555ed1942681c839e35a.