From e36d42c990d2850258a5870ea7154ddc3a7956cd Mon Sep 17 00:00:00 2001 From: Brian J Jones Date: Thu, 26 Apr 2018 14:38:36 -0700 Subject: [PATCH 1/2] Adding dynamic mode doc and updating ashell doc Signed-off-by: Brian J Jones --- docs/ashell.md | 4 ++-- docs/dynamic.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 docs/dynamic.md 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..58735164b --- /dev/null +++ b/docs/dynamic.md @@ -0,0 +1,34 @@ +Dynamic mode - Adds the ability to run JS from the filesystem +============================================================ + +* [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. From 5bc2df444b95a24c0b6b519f7a3f4e17b57684f4 Mon Sep 17 00:00:00 2001 From: Brian J Jones Date: Fri, 27 Apr 2018 09:40:04 -0700 Subject: [PATCH 2/2] Fixing whitespace and title Signed-off-by: Brian J Jones --- docs/dynamic.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dynamic.md b/docs/dynamic.md index 58735164b..e3ab99ad4 100644 --- a/docs/dynamic.md +++ b/docs/dynamic.md @@ -1,4 +1,4 @@ -Dynamic mode - Adds the ability to run JS from the filesystem +Dynamic mode - Run JavaScript from the filesystem at will ============================================================ * [Introduction](#introduction) @@ -31,4 +31,4 @@ a different JavaScript file from the filesystem. Remember your current JavaScrip 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. +Build ZJS with your primary JavaScript file and reboot.