From 8233534d6aa464bf624ead2b027c2914e933dcfc Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Tue, 15 Oct 2024 03:27:04 +0300 Subject: [PATCH] merge p3 --- applications/system/js_app/application.fam | 40 +++++++++++++++++++ .../system/js_app/modules/js_blebeacon.c | 4 +- .../js_app/modules/js_subghz/js_subghz.c | 4 +- .../js_app/modules/js_usbdisk/js_usbdisk.c | 4 +- .../system/js_app/modules/js_vgm/js_vgm.c | 4 +- .../system/js_app/modules/js_widget.c | 4 +- 6 files changed, 55 insertions(+), 5 deletions(-) diff --git a/applications/system/js_app/application.fam b/applications/system/js_app/application.fam index 36fd7b16c..276690b93 100644 --- a/applications/system/js_app/application.fam +++ b/applications/system/js_app/application.fam @@ -129,3 +129,43 @@ App( requires=["js_app"], sources=["modules/js_storage.c"], ) + +App( + appid="js_widget", + apptype=FlipperAppType.PLUGIN, + entry_point="js_widget_ep", + requires=["js_app"], + sources=["modules/js_widget.c"], +) + +App( + appid="js_vgm", + apptype=FlipperAppType.PLUGIN, + entry_point="js_vgm_ep", + requires=["js_app"], + sources=["modules/js_vgm/*.c", "modules/js_vgm/ICM42688P/*.c"], +) + +App( + appid="js_subghz", + apptype=FlipperAppType.PLUGIN, + entry_point="js_subghz_ep", + requires=["js_app"], + sources=["modules/js_subghz/*.c"], +) + +App( + appid="js_blebeacon", + apptype=FlipperAppType.PLUGIN, + entry_point="js_blebeacon_ep", + requires=["js_app"], + sources=["modules/js_blebeacon.c"], +) + +App( + appid="js_usbdisk", + apptype=FlipperAppType.PLUGIN, + entry_point="js_usbdisk_ep", + requires=["js_app"], + sources=["modules/js_usbdisk/*.c"], +) diff --git a/applications/system/js_app/modules/js_blebeacon.c b/applications/system/js_app/modules/js_blebeacon.c index 1d79457c8..379c6a18b 100644 --- a/applications/system/js_app/modules/js_blebeacon.c +++ b/applications/system/js_app/modules/js_blebeacon.c @@ -193,7 +193,8 @@ static void js_blebeacon_keep_alive(struct mjs* mjs) { mjs_return(mjs, MJS_UNDEFINED); } -static void* js_blebeacon_create(struct mjs* mjs, mjs_val_t* object) { +static void* js_blebeacon_create(struct mjs* mjs, mjs_val_t* object, JsModules* modules) { + UNUSED(modules); JsBlebeaconInst* blebeacon = malloc(sizeof(JsBlebeaconInst)); mjs_val_t blebeacon_obj = mjs_mk_object(mjs); mjs_set(mjs, blebeacon_obj, INST_PROP_NAME, ~0, mjs_mk_foreign(mjs, blebeacon)); @@ -231,6 +232,7 @@ static const JsModuleDescriptor js_blebeacon_desc = { "blebeacon", js_blebeacon_create, js_blebeacon_destroy, + NULL, }; static const FlipperAppPluginDescriptor plugin_descriptor = { diff --git a/applications/system/js_app/modules/js_subghz/js_subghz.c b/applications/system/js_app/modules/js_subghz/js_subghz.c index f0e21c1ff..daa46e5e5 100644 --- a/applications/system/js_app/modules/js_subghz/js_subghz.c +++ b/applications/system/js_app/modules/js_subghz/js_subghz.c @@ -479,7 +479,8 @@ static void js_subghz_end(struct mjs* mjs) { mjs_return(mjs, MJS_UNDEFINED); } -static void* js_subghz_create(struct mjs* mjs, mjs_val_t* object) { +static void* js_subghz_create(struct mjs* mjs, mjs_val_t* object, JsModules* modules) { + UNUSED(modules); JsSubghzInst* js_subghz = malloc(sizeof(JsSubghzInst)); mjs_val_t subghz_obj = mjs_mk_object(mjs); @@ -519,6 +520,7 @@ static const JsModuleDescriptor js_subghz_desc = { "subghz", js_subghz_create, js_subghz_destroy, + NULL, }; static const FlipperAppPluginDescriptor plugin_descriptor = { diff --git a/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c b/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c index 2fe0887ef..c79aba176 100644 --- a/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c +++ b/applications/system/js_app/modules/js_usbdisk/js_usbdisk.c @@ -167,7 +167,8 @@ static void js_usbdisk_stop(struct mjs* mjs) { mjs_return(mjs, MJS_UNDEFINED); } -static void* js_usbdisk_create(struct mjs* mjs, mjs_val_t* object) { +static void* js_usbdisk_create(struct mjs* mjs, mjs_val_t* object, JsModules* modules) { + UNUSED(modules); JsUsbdiskInst* usbdisk = malloc(sizeof(JsUsbdiskInst)); mjs_val_t usbdisk_obj = mjs_mk_object(mjs); mjs_set(mjs, usbdisk_obj, INST_PROP_NAME, ~0, mjs_mk_foreign(mjs, usbdisk)); @@ -188,6 +189,7 @@ static const JsModuleDescriptor js_usbdisk_desc = { "usbdisk", js_usbdisk_create, js_usbdisk_destroy, + NULL, }; static const FlipperAppPluginDescriptor plugin_descriptor = { diff --git a/applications/system/js_app/modules/js_vgm/js_vgm.c b/applications/system/js_app/modules/js_vgm/js_vgm.c index f7c0d6fcd..2d7a56b6e 100644 --- a/applications/system/js_app/modules/js_vgm/js_vgm.c +++ b/applications/system/js_app/modules/js_vgm/js_vgm.c @@ -119,7 +119,8 @@ static void js_vgm_delta_yaw(struct mjs* mjs) { mjs_return(mjs, mjs_mk_number(mjs, 0)); } -static void* js_vgm_create(struct mjs* mjs, mjs_val_t* object) { +static void* js_vgm_create(struct mjs* mjs, mjs_val_t* object, JsModules* modules) { + UNUSED(modules); JsVgmInst* vgm = malloc(sizeof(JsVgmInst)); vgm->imu = imu_alloc(); vgm->present = imu_present(vgm->imu); @@ -146,6 +147,7 @@ static const JsModuleDescriptor js_vgm_desc = { name: "vgm", create: js_vgm_create, destroy: js_vgm_destroy, + api_interface: NULL, }; static const FlipperAppPluginDescriptor plugin_descriptor = { diff --git a/applications/system/js_app/modules/js_widget.c b/applications/system/js_app/modules/js_widget.c index 6c8e79b2e..64390abe7 100644 --- a/applications/system/js_app/modules/js_widget.c +++ b/applications/system/js_app/modules/js_widget.c @@ -810,7 +810,8 @@ static void widget_draw_callback(Canvas* canvas, void* model) { } } -static void* js_widget_create(struct mjs* mjs, mjs_val_t* object) { +static void* js_widget_create(struct mjs* mjs, mjs_val_t* object, JsModules* modules) { + UNUSED(modules); JsWidgetInst* widget = malloc(sizeof(JsWidgetInst)); mjs_val_t widget_obj = mjs_mk_object(mjs); @@ -908,6 +909,7 @@ static const JsModuleDescriptor js_widget_desc = { "widget", js_widget_create, js_widget_destroy, + NULL, }; static const FlipperAppPluginDescriptor widget_plugin_descriptor = {