diff --git a/docs/ashell.md b/docs/ashell.md index 17ae95cd5..3f1efeca4 100644 --- a/docs/ashell.md +++ b/docs/ashell.md @@ -8,10 +8,10 @@ Introduction ------------ -This shell focus is on creating an interface to be able to run commands and +The focus of ashell is to create an interface to be able to run commands and arbitrary JavaScript directly from the USB port of a Zephyr enabled device. -Although the shell would look like a common Unix Bash, it is heavily limited +Although this shell looks like a common Unix Bash, it is heavily limited due the constraints of the micro-controller. NOTE: Because the filesystem module is used by ashell, the SPI module is also diff --git a/docs/dynamic.md b/docs/dynamic.md new file mode 100644 index 000000000..e3ab99ad4 --- /dev/null +++ b/docs/dynamic.md @@ -0,0 +1,34 @@ +Dynamic mode - Run JavaScript from the filesystem at will +============================================================ + +* [Introduction](#introduction) +* [Compilation](#compilation) +* [How to use](#howtouse) + +Introduction +------------ +Compiling ZJS in dynamic mode gives you the ability to run a JavaScript file from +the filesystem of the board. Note that running a new JavaScript file will halt +the current one. Also note that you need to include all the modules you wish to +use in the original JavaScript file you compile ZJS with. If the JavaScript you +try to run from the filesystem calls for a module not included in the original +JavaScript file, it will fail. + +Compilation +------------ +This command will enable dynamic mode: +```bash +$ make dynamic +``` + +How to use +------- +Build ZJS with ashell, then copy any JavaScript files you want to run onto the +filesystem using 'save'. + +In your primary JavaScript file, use 'runJS('filename.js')' whenever you want to load +a different JavaScript file from the filesystem. Remember your current JavaScript +will halt once this command is called. You can add this command anywhere you want +a different JavaScript to load. + +Build ZJS with your primary JavaScript file and reboot.