-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
1,959 additions
and
1,283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
.vscode/ | ||
build/ | ||
build-freertos/ | ||
build-*/ | ||
.idea/ | ||
sdkconfig | ||
sdkconfig.old | ||
.DS_Store | ||
js-snapshots.h | ||
js-snapshots.c | ||
rtnode-snapshots.h | ||
rtnode-snapshots.c | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Available JerryScript debugger tools | ||
|
||
- JerryScript console debugger client ( jerry_client.py ) | ||
- IoT.js Code ( https://github.com/jerryscript-project/iotjscode ) | ||
- IoT.js Code ( https://github.com/jerryscript-project/rtnodecode ) | ||
- JerryScript debugger Chrome webtool ( https://github.com/jerryscript-project/jerryscript-debugger-ts ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#ifndef _JS_MAIN_H_ | ||
#define _JS_MAIN_H_ | ||
|
||
#include "rtev.h" | ||
#include "rtnode-binding.h" | ||
#include "rtnode-error.h" | ||
#include "rtnode-logger.h" | ||
|
||
#define NODE_MAJOR_VERSION 0 | ||
#define NODE_MINOR_VERSION 0 | ||
#define NODE_PATCH_VERSION 1 | ||
|
||
#if !defined(STRINGIFY) | ||
#define STRINGIFY(x) #x | ||
#endif /* STRINGIFY */ | ||
|
||
#if !defined(TOSTRING) | ||
#define TOSTRING(x) STRINGIFY(x) | ||
#endif /* TOSTRING */ | ||
|
||
#define RTNODE_ABORT() \ | ||
do { RTNODE_LOG_E("abort message: %s:%d", __FILE__, __LINE__); abort(); } while (false) | ||
|
||
#define RTNODE_ASSERT(exp) \ | ||
do { \ | ||
if(!(exp)) { \ | ||
RTNODE_LOG_E("assert message: %s", #exp); \ | ||
assert(0); \ | ||
} \ | ||
} while (false) | ||
|
||
#define RTNODE_DEFINE_NATIVE_HANDLE_INFO_THIS_MODULE(name) \ | ||
static void rtnode_##name##_destroy(rtnode_##name##_t* wrap); \ | ||
static const jerry_object_native_info_t this_module_native_info = { \ | ||
.free_cb = (jerry_object_native_free_callback_t)rtnode_##name##_destroy \ | ||
} | ||
|
||
#define RTNODE_CHECK_FATAL_ERROR(jobj, source) \ | ||
if (jerry_value_is_error(jobj)) { \ | ||
rtnode_on_fatal_error(jobj, source); \ | ||
assert(0); \ | ||
} | ||
|
||
#define RTNODE_CREATE_ERROR(TYPE, message) \ | ||
jerry_create_error(JERRY_ERROR_##TYPE, (const jerry_char_t*)message) | ||
|
||
#define RTNODE_DECLARE_PTR(JOBJ, TYPE, NAME) \ | ||
TYPE* NAME = NULL; \ | ||
do { \ | ||
if (!jerry_get_object_native_pointer(JOBJ, (void**)&NAME, \ | ||
&native_info)) { \ | ||
return RTNODE_CREATE_ERROR(COMMON, "Internal"); \ | ||
} \ | ||
} while (0) | ||
|
||
#define RTNODE_FUNCTION(name) \ | ||
static jerry_value_t name(const jerry_value_t jfunc, \ | ||
const jerry_value_t jthis, \ | ||
const jerry_value_t jargv[], \ | ||
const jerry_length_t jargc) | ||
|
||
#ifndef RTNODE_VM_HEAP_SIZE | ||
#define RTNODE_VM_HEAP_SIZE 128 * 1024 | ||
#endif | ||
|
||
#define RTNODE_BACKTRACE_DEPTH 11 | ||
|
||
/* Avoid compiler warnings if needed. */ | ||
#define RTNODE_UNUSED(x) ((void)(x)) | ||
|
||
void rtnode_free(void *ptr); | ||
|
||
void* rtnode_malloc(size_t size); | ||
|
||
void* rtnode_realloc(void *ptr, size_t size); | ||
|
||
void* rtnode_calloc(size_t count, size_t size); | ||
|
||
void* rtnode_jerry_alloc(size_t size, void *cb_data); | ||
|
||
uint64_t rtnode_get_memory_total(); | ||
|
||
uint64_t rtnode_get_memory_alloc_count(); | ||
|
||
typedef struct { | ||
rtev_ctx_t *rtev; | ||
jerry_context_t* jerry; | ||
} rtnode_context_t; | ||
|
||
extern rtnode_context_t *js_ctx; | ||
|
||
extern int rtnode_start(); | ||
|
||
#endif //_JS_MAIN_H_ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#include "rt_node.h" | ||
#include "rt-node.h" | ||
|
||
int main(int argc ,char **argv) { | ||
int app_main(int argc ,char **argv) { | ||
rtnode_start(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "rt_node.h" | ||
#include "rt-node.h" | ||
|
||
int main(int argc ,char **argv) { | ||
rtnode_start(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.