See the Espruino Compilation Page
This project does the following:
- Turns JavaScript code into C++ (that calls into Espruino library functions for more complicated operations)
- Compiles the code with GCC
- Links and Extracts a relocatable blob of Thumb code
- Formats it into JS that can be run in Espruino
src/utils.js
- general utilitiessrc/infer.js
- Type inferral on parse treesrc/compile.js
- Parse tree -> C++, and calling of GCCserver.js
- server that performs compilation for the Web IDEtest.js
- simple command-line testtest_espruino.js
- test in such a way that the C code is compiled into Espruino - allowing nice easy GDB debug
You need:
- A new node.js
- gcc-arm-embedded in your path
- Run
node server.js
- Go into Web IDE settings and set
Communications / JavaScript Compiler URL
tohttp://localhost:32766