* Replace JERRY_JS_PARSER feature guard with JERRY_DISABLE_JS_PARSER All feature guards of jerry-core are deciding about the inclusion or exclusion of a feature based on the state (defined or undefined) of a macro -- except for the JS parser guard, which requires `JERRY_JS_PARSER` to be defined with a value of either 0 or 1. This has some issues: - The engine cannot be built with a "clean" compiler invocation, i.e., without any `-D` command line macro definitions. This is painful for targets that must use a different build system from the project's own python/cmake-based one. - Some build systems in targets and even some code in jerry-code are already confused about the different semantics of `JERRY_JS_PARSER`, and simply define it without a value and make decisions based on the macro being simply defined or not. This patch renames the guard to `JERRY_DISABLE_JS_PARSER` and makes use of it in jerry-core based on its state, not based on its value. As obvious from the guard name, the default for the JS parser is that it is included in the build. The patch also touches those targets in the repository that explicitly defined the original macro (correctly or incorrectly). * Make cppcheck verbose Cppcheck can be quite slow sometimes, especially on Travis CI, which has a "10 mins without output means failure" rule. As the code base of the project grows, we start to undeterministically fall over that limit. Thus, this PR makes cppcheck verbose to ensure that it keeps Travis CI continuously fed with output. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
JerryScript with mbed OS 5
TL;DR? jump straight to quickstart
Introduction
This directory contains the necessary code to build JerryScript for devices capable of running mbed OS 5. It has been tested with the following boards so far:
- Nordic Semiconductor NRF52 Development Kit
- NXP Freedom K64F
- STM NUCLEO F401RE
- Silicon Labs EFM32 Giant Gecko
Features
Peripheral Drivers
Peripheral Drivers are intended as a 1-to-1 mapping to mbed C++ APIs, with a few differences (due to differences between JavaScript and C++ like lack of operator overloading).
- DigitalOut
- InterruptIn
- I2C
- setInterval and setTimeout using mbed-event
Dependencies
mbed CLI
mbed CLI is used as the build tool for mbed OS 5. You can find out how to install it in the official documentation.
arm-none-eabi-gcc
arm-none-eabi-gcc is the only currently tested compiler for jerryscript on mbed, and instructions for building can be found as part of the mbed-cli installation instructions above.
make
make is used to automate the process of fetching dependencies, and making sure that mbed-cli is called with the correct arguments.
nodejs
npm is used to install the dependencies in the local node_modules folder.
gulp
gulp is used to automate tasks, like cloning repositories or generate source files. If you create an own project, for more info see mbed-js-gulp.
(optional) jshint
jshint is used to statically check your JavaScript code, as part of the build process. This ensures that pins you are using in your code are available on your chosen target platform.
Quick Start
Once you have all of your dependencies installed, you can build the example project as follows:
git clone https://github.com/ARMmbed/mbed-js-example
cd mbed-js-example
npm install
gulp --target=YOUR_TARGET_NAME
The produced file (in build/out/YOUR_TARGET_NAME) can then be uploaded to your board, and will run when you press reset.