Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Adding dynamic mode doc and updating ashell doc #1876

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/ashell.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions docs/dynamic.md
Original file line number Diff line number Diff line change
@@ -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.