9#include "js_runner_types.h"
15#pragma GCC diagnostic push
16#pragma GCC diagnostic ignored "-Wattributes"
17#include <jerryscript.h>
18#pragma GCC diagnostic pop
23#define JS_TRACE(...) FURI_LOG_D(TAG, __VA_ARGS__)
28#define MIN_INTERVAL_DELAY_MS 10.0f
29#define MAX_FETCH_MESSAGES 32
30#define MAX_COMMAND_MESSAGES 4
32#define APP_THREAD_STACK_SIZE (8 * 1024)
34#define JS_RUNNER_APP_FLAG_IDLE 1
36#define PTR_HASH(p) ((size_t)(p))
40#define WITH_JS_RUNNER_APP(APP, BLOCK) \
42 JsRunnerApp* APP = js_runner_static_context.app; \
43 furi_assert(APP->thread == furi_thread_get_current()); \
47#define JS_ARG(n) (args[(n)])
48#define JS_ARG_OR_UNDEFINED(n) (args_count > (n) ? args[(n)] : jerry_undefined())
51void js_run_jobs(
void);
71void js_runner_handle_fatal_error(jerry_fatal_code_t code);
82const char* js_runner_app_get_id(
const JsRunnerApp* app);
84void js_runner_heap_destructor(
void*
object,
void* user_p);
Library for building fetch-like HTTP clients.
void js_runner_defer(JsRunnerApp *app, JsRunnerDeferredCallback cb, void *context)
Defer execution of a callback until before jerry_cleanup.
Definition js_runner.c:954
void * js_runner_thread_context_get(void)
Get Jerryscript context for current thread.
Definition js_runner.c:39
void js_runner_thread_context_free(void)
Free Jerryscript context for current thread.
Definition js_runner.c:31
size_t js_runner_thread_context_alloc(size_t context_size)
Allocate Jerryscript context for current thread.
Definition js_runner.c:21
void js_runner_cancel_defer(JsRunnerApp *app, JsRunnerDeferredCallback cb, void *context)
Cancel a deferred callback execution.
Definition js_runner.c:958
bool js_runner_get_root_path(FuriString *path)
Get root path of the current JS app (folder containing entry point).
Definition js_runner.c:67
Utility functions for working with JS values.
Filesystem path utilities.
APIs for working with storages, directories and files.
Definition js_runner_types.h:99
Definition js_runner_types.h:145