All Projects → yodaos-project → rt-node

yodaos-project / rt-node

Licence: Apache-2.0 license
A JavaScript runtime library for RTOS.

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to rt-node

Qpcpp
QP/C++ real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 124 (+439.13%)
Mutual labels:  rtos
Helios
The free embedded operating system.
Stars: ✭ 223 (+869.57%)
Mutual labels:  rtos
adbd
Android Debug Bridge daemon implementation in RT-Thread
Stars: ✭ 37 (+60.87%)
Mutual labels:  rtos
M5p01 muprokaron
A tiny real-time kernel focusing on formal reliability and simplicity.
Stars: ✭ 132 (+473.91%)
Mutual labels:  rtos
Lwgsm
Lightweight AT commands parser for SimCOM GSM modules
Stars: ✭ 201 (+773.91%)
Mutual labels:  rtos
Talks
schedule and materials about my presentations
Stars: ✭ 245 (+965.22%)
Mutual labels:  rtos
Uc Os2
µC/OS-II is a preemptive, highly portable, and scalable real-time kernels. Designed for ease of use on a huge number of CPU architectures.
Stars: ✭ 120 (+421.74%)
Mutual labels:  rtos
drone-stm32-map
STM32 peripheral mappings for Drone, an Embedded Operating System.
Stars: ✭ 16 (-30.43%)
Mutual labels:  rtos
Lwesp
Lightweight Espressif AT parser library for ESP8266 and ESP32 devices.
Stars: ✭ 212 (+821.74%)
Mutual labels:  rtos
mtkernel 3
micro T-Kernel 3.0
Stars: ✭ 105 (+356.52%)
Mutual labels:  rtos
Crect
A C++, compile-time, reactive RTOS for the Stack Resource Policy based Real-Time For the Masses kernel
Stars: ✭ 160 (+595.65%)
Mutual labels:  rtos
Polymcu
An open framework for micro-controller software
Stars: ✭ 173 (+652.17%)
Mutual labels:  rtos
IntrOS
Free cooperative operating system (OS) for microcontrollers
Stars: ✭ 38 (+65.22%)
Mutual labels:  rtos
Zephyr Doc
《Zephyr OS 文档 - 中文版》
Stars: ✭ 127 (+452.17%)
Mutual labels:  rtos
picoos
pico]OS realtime operating system
Stars: ✭ 51 (+121.74%)
Mutual labels:  rtos
Luatos
合宙LuatOS -- Lua base RTOS, build for many embedded systems. LuatOS是运行在嵌入式硬件的实时操作系统
Stars: ✭ 124 (+439.13%)
Mutual labels:  rtos
Mqttclient
A high-performance, high-stability, cross-platform MQTT client, developed based on the socket API, can be used on embedded devices (FreeRTOS / LiteOS / RT-Thread / TencentOS tiny), Linux, Windows, Mac, with a very concise The API interface realizes the quality of service of QOS2 with very few resources, and seamlessly connects the mbedtls encryption library.
Stars: ✭ 234 (+917.39%)
Mutual labels:  rtos
dandelion
🌀 Microkernel Real-Time Operating System in Rust
Stars: ✭ 20 (-13.04%)
Mutual labels:  rtos
netxduo
Azure RTOS NetX Duo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
Stars: ✭ 151 (+556.52%)
Mutual labels:  rtos
FPGAmp
720p FPGA Media Player (RISC-V + Motion JPEG + SD + HDMI on an Artix 7)
Stars: ✭ 190 (+726.09%)
Mutual labels:  rtos

rt-node

License

rt-node is a lightweight JavaScript framework for RTOS, also support unix like systems for debugging.

The following runtime modules are built in:

  • timer
  • require
  • utils
  • console
  • N-API

N-API is supported in order to be compatible with different embed JavaScript engines, the following N-API features are WIP:

  • thread safe function

Dependencies

  • JerryScript, a lightweight JavaScript engine
  • rv, a tiny event loop library

JavaScript Sample

speaker.js

'use strict';
class Speaker {
  constructor(content) {
    this.content = content;
  }
  say() {
    console.log(this.content);
  }
}
module.exports = Speaker;

app.js

'use strict';
const Speaker = require('speaker');
const speaker = new Speaker('hello world');
setTimeout(() => {
  speaker.say();
}, 3000);

N-API Sample

'use strict';
// The curl module depends on libcurl, the source file is sample/unix/curl.c
const curl = require('curl');
const startTime = Date.now();
curl.get('http://www.example.com', (body) => {
  console.log(`get body in ${Date.now() - startTime}ms`, body);
});

Build

JavaScript sources are packaged in src/rtnode-snapshots.c/h, set JS_ROOT as your JavaScript sources root directory for cmake to package them, app.js is the entry of user code.

rtnode use CMake to build library or samples. The easiest way to build is as follows:

$ cmake -B./build -H. -DJS_ROOT=Your_js_files_root_directory
$ make -C./build -j8

The above commands will generate librtnode.a in ./build directory.

For cross compile, add the following flags:

  • CMAKE_C_COMPILER, full path for c compiler
  • CMAKE_SYSTEM_PROCESSOR, the name of the CPU CMake is building for
  • CMAKE_SYSTEM_NAME, set Generic to indicate cross compile

Here is an example for Xtensa toolchain:

$ cmake -B./build-xtensa -H. \
  -DCMAKE_C_COMPILER=xtensa-esp32-elf-gcc \
  -DCMAKE_SYSTEM_PROCESSOR=xtensa \
  -DCMAKE_SYSTEM_NAME=Generic \
  -DJS_ROOT=Your_js_files_root_directory
$ make -C./build-xtensa -j8

Sample

Currently support unix and esp-idf build framework.

For unix like systems

$ cmake -B./build -H. -DSAMPLE=unix -DJS_ROOT=./samples -DJERRY_PROFILE=es2015-subset
$ make -C./build
$ ./build/rtnode-unix/rtnode-unix # run sample

For esp-idf:

$ cmake -B./build-espidf -H. \
  -DCMAKE_C_COMPILER=xtensa-esp32-elf-gcc \
  -DCMAKE_SYSTEM_PROCESSOR=xtensa \
  -DCMAKE_SYSTEM_NAME=Generic \
  -DSAMPLE=esp-idf \
  -DJS_ROOT=./samples \
  -DJERRY_PROFILE=es2015-subset
$ make -C./build-espidf -j8

The esp-idf products will generate in ./build-espidf/rtnode-build, then use idf.py flash to flash the binaries that you just built onto your ESP32 board. For more information, please refer to the esp-idf document.

LICENSE

Apache-2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].