From 3087d4b2ad68f4f21a1c2c70d05acfb7385e2a15 Mon Sep 17 00:00:00 2001 From: David Lee Date: Thu, 1 Feb 2024 21:21:18 +0100 Subject: [PATCH 1/2] Fixed initial crash after creation of chain with Subghz element --- application.fam | 2 +- docs/changelog.md | 3 +++ models/subghz/xremote_sg_remote.c | 8 +------- scenes/xremote_scene_ir_list.c | 3 --- scenes/xremote_scene_sg_list.c | 4 ---- xremote_i.h | 8 +------- 6 files changed, 6 insertions(+), 22 deletions(-) diff --git a/application.fam b/application.fam index db01bdf7e48..9f58073a2b4 100644 --- a/application.fam +++ b/application.fam @@ -6,7 +6,7 @@ App( stack_size=3 * 1024, fap_icon="icons/xremote_10px.png", fap_icon_assets="icons", - fap_version="2.2", + fap_version="2.3", fap_category="Infrared", fap_author="Leedave", fap_description="One-Click, sends multiple commands", diff --git a/docs/changelog.md b/docs/changelog.md index 6eb514fc71e..9b58e8dd2f0 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,6 @@ +## 2.3 +- Fixed Crash after creating chains with SubGhz Items + ## 2.2 - Fixed incompatibility to Flipper-catalog / uFBT compiler diff --git a/models/subghz/xremote_sg_remote.c b/models/subghz/xremote_sg_remote.c index f5dc233ee6b..cae52a3d01d 100644 --- a/models/subghz/xremote_sg_remote.c +++ b/models/subghz/xremote_sg_remote.c @@ -5,7 +5,6 @@ struct SubGhzRemote { FuriString* name; FuriString* filename; - FuriString* path; }; const char* xremote_sg_remote_get_name(SubGhzRemote* remote) { @@ -20,13 +19,11 @@ SubGhzRemote* xremote_sg_remote_alloc() { SubGhzRemote* remote = malloc(sizeof(SubGhzRemote)); remote->name = furi_string_alloc(); remote->filename = furi_string_alloc(); - remote->path = furi_string_alloc(); - + return remote; } void xremote_sg_remote_free(SubGhzRemote* remote) { - furi_string_free(remote->path); furi_string_free(remote->name); furi_string_free(remote->filename); @@ -52,10 +49,7 @@ bool xremote_sg_remote_load(SubGhzRemote* remote, FuriString* path) { if(dotPosition != NULL) { // check if there is a dot in the file name *dotPosition = '\0'; // set the dot position to NULL character to truncate the string } - //remote->name = fileName; furi_string_set_str(remote->name, fileName); - //furi_string_set_str(remote->filename, fileName); - //free(fileName); uint32_t version; if(!flipper_format_read_header(ff, buf, &version)) break; if(!furi_string_equal(buf, "Flipper SubGhz RAW File") || (version != 1)) break; diff --git a/scenes/xremote_scene_ir_list.c b/scenes/xremote_scene_ir_list.c index b1dc63fc507..d20d91bb500 100644 --- a/scenes/xremote_scene_ir_list.c +++ b/scenes/xremote_scene_ir_list.c @@ -23,11 +23,8 @@ void xremote_scene_ir_list_on_enter(void* context) { if(success) { //Load Remote Button View - //scene_manager_next_scene(app->scene_manager, XRemoteSceneCreateAdd); - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_next_scene(app->scene_manager, XRemoteSceneIrRemote); } else { - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_previous_scene(app->scene_manager); } } diff --git a/scenes/xremote_scene_sg_list.c b/scenes/xremote_scene_sg_list.c index cbefd9a4da9..b6896271947 100644 --- a/scenes/xremote_scene_sg_list.c +++ b/scenes/xremote_scene_sg_list.c @@ -19,16 +19,12 @@ void xremote_scene_sg_list_on_enter(void* context) { view_dispatcher_switch_to_view(app->view_dispatcher, XRemoteViewIdStack); xremote_sg_remote_load(app->sg_remote_buffer, app->file_path); - //xremote_ir_remote_load(app->ir_remote_buffer, app->file_path); xremote_cross_remote_add_subghz(app->cross_remote, app->sg_remote_buffer); } if(success) { //Load Remote Button View - //scene_manager_next_scene(app->scene_manager, XRemoteSceneCreateAdd); - //scene_manager_next_scene(app->scene_manager, XRemoteSceneWip); scene_manager_next_scene(app->scene_manager, XRemoteSceneCreate); - //scene_manager_next_scene(app->scene_manager, XRemoteSceneIrRemote); } else { scene_manager_previous_scene(app->scene_manager); } diff --git a/xremote_i.h b/xremote_i.h index 576d8ce02d1..7274027e8cc 100644 --- a/xremote_i.h +++ b/xremote_i.h @@ -111,10 +111,4 @@ typedef struct CrossRemote CrossRemote; typedef struct CrossRemoteItem CrossRemoteItem; typedef struct XRemoteTransmit XRemoteTransmit; -typedef struct XRemotePauseSet XRemotePauseSet; -//typedef struct XRemoteInfoscreen XRemoteInfoscreen; - -//typedef struct InfraredRemote InfraredRemote; -//typedef struct InfraredRemoteButton InfraredRemoteButton; -//typedef struct InfraredSignal InfraredSignal; -//typedef struct InfraredRawSignal InfraredRawSignal; \ No newline at end of file +typedef struct XRemotePauseSet XRemotePauseSet; \ No newline at end of file From 8fc794fa95ddcee7179da934291c56dd807f79b6 Mon Sep 17 00:00:00 2001 From: David Lee Date: Thu, 1 Feb 2024 21:22:25 +0100 Subject: [PATCH 2/2] ufbt format --- models/subghz/xremote_sg_remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/subghz/xremote_sg_remote.c b/models/subghz/xremote_sg_remote.c index cae52a3d01d..de19edd586a 100644 --- a/models/subghz/xremote_sg_remote.c +++ b/models/subghz/xremote_sg_remote.c @@ -19,7 +19,7 @@ SubGhzRemote* xremote_sg_remote_alloc() { SubGhzRemote* remote = malloc(sizeof(SubGhzRemote)); remote->name = furi_string_alloc(); remote->filename = furi_string_alloc(); - + return remote; }