diff --git a/applications/main/subghz_remote/application.fam b/applications/main/subghz_remote/application.fam index 65095573f..804ac0b7c 100644 --- a/applications/main/subghz_remote/application.fam +++ b/applications/main/subghz_remote/application.fam @@ -12,6 +12,6 @@ App( "dialogs", ], icon="A_SubGHzRemote_14", - stack_size=3 * 1024, + stack_size=2 * 1024, order=11, ) \ No newline at end of file diff --git a/applications/main/subghz_remote/scenes/subrem_scene_config.h b/applications/main/subghz_remote/scenes/subrem_scene_config.h index 68b205169..45e55850a 100644 --- a/applications/main/subghz_remote/scenes/subrem_scene_config.h +++ b/applications/main/subghz_remote/scenes/subrem_scene_config.h @@ -1,3 +1,5 @@ +#ifndef SUBREM_LIGHT ADD_SCENE(subrem, start, Start) +#endif ADD_SCENE(subrem, open_map_file, OpenMapFile) ADD_SCENE(subrem, remote, Remote) \ No newline at end of file diff --git a/applications/main/subghz_remote/scenes/subrem_scene_open_map_file.c b/applications/main/subghz_remote/scenes/subrem_scene_open_map_file.c index f1b8b2ec2..1e917580c 100644 --- a/applications/main/subghz_remote/scenes/subrem_scene_open_map_file.c +++ b/applications/main/subghz_remote/scenes/subrem_scene_open_map_file.c @@ -5,19 +5,11 @@ void subrem_scene_open_map_file_on_enter(void* context) { SubGhzRemoteApp* app = context; SubRemLoadMapState load_state = subrem_load_from_file(app); - uint32_t start_scene_state = - scene_manager_get_scene_state(app->scene_manager, SubRemSceneStart); - // TODO if optimization - - if(load_state == SubRemLoadMapStateBack) { - if(!scene_manager_previous_scene(app->scene_manager)) { - scene_manager_stop(app->scene_manager); - view_dispatcher_stop(app->view_dispatcher); - } - } else if(start_scene_state == SubmenuIndexSubRemOpenMapFile) { - if(load_state != SubRemLoadMapStateOK && load_state != SubRemLoadMapStateNotAllOK && - load_state != SubRemLoadMapStateBack) { + if(load_state == SubRemLoadMapStateOK || load_state == SubRemLoadMapStateNotAllOK) { + scene_manager_next_scene(app->scene_manager, SubRemSceneRemote); + } else { + if(load_state != SubRemLoadMapStateBack) { #ifdef SUBREM_LIGHT dialog_message_show_storage_error(app->dialogs, "Can't load\nMap file"); #else @@ -32,15 +24,10 @@ void subrem_scene_open_map_file_on_enter(void* context) { dialog_message_free(message); #endif } - if(load_state == SubRemLoadMapStateOK || load_state == SubRemLoadMapStateNotAllOK) { - scene_manager_next_scene(app->scene_manager, SubRemSceneRemote); - } else { - // TODO: Map Preset Reset - if(!scene_manager_search_and_switch_to_previous_scene( - app->scene_manager, SubRemSceneStart)) { - scene_manager_stop(app->scene_manager); - view_dispatcher_stop(app->view_dispatcher); - } + // TODO: Map Preset Reset + if(!scene_manager_previous_scene(app->scene_manager)) { + scene_manager_stop(app->scene_manager); + view_dispatcher_stop(app->view_dispatcher); } } } diff --git a/applications/main/subghz_remote/scenes/subrem_scene_remote.c b/applications/main/subghz_remote/scenes/subrem_scene_remote.c index 644f8daac..a2e307fd9 100644 --- a/applications/main/subghz_remote/scenes/subrem_scene_remote.c +++ b/applications/main/subghz_remote/scenes/subrem_scene_remote.c @@ -49,13 +49,9 @@ bool subrem_scene_remote_on_event(void* context, SceneManagerEvent event) { SubGhzRemoteApp* app = context; if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubRemCustomEventViewRemoteBack) { - if(!scene_manager_search_and_switch_to_previous_scene( - app->scene_manager, SubRemSceneOpenMapFile)) { - if(!scene_manager_search_and_switch_to_previous_scene( - app->scene_manager, SubRemSceneStart)) { - scene_manager_stop(app->scene_manager); - view_dispatcher_stop(app->view_dispatcher); - } + if(!scene_manager_previous_scene(app->scene_manager)) { + scene_manager_stop(app->scene_manager); + view_dispatcher_stop(app->view_dispatcher); } return true; } else if( diff --git a/applications/main/subghz_remote/scenes/subrem_scene_start.c b/applications/main/subghz_remote/scenes/subrem_scene_start.c index dd840c40d..e780b54ce 100644 --- a/applications/main/subghz_remote/scenes/subrem_scene_start.c +++ b/applications/main/subghz_remote/scenes/subrem_scene_start.c @@ -33,10 +33,10 @@ void subrem_scene_start_on_enter(void* context) { // SubmenuIndexSubGhzRemoteAbout, // subrem_scene_start_submenu_callback, // app); - +#ifndef SUBREM_LIGHT submenu_set_selected_item( submenu, scene_manager_get_scene_state(app->scene_manager, SubRemSceneStart)); - +#endif view_dispatcher_switch_to_view(app->view_dispatcher, SubRemViewIDSubmenu); } @@ -48,8 +48,10 @@ bool subrem_scene_start_on_event(void* context, SceneManagerEvent event) { if(event.type == SceneManagerEventTypeCustom) { if(event.event == SubmenuIndexSubRemOpenMapFile) { +#ifndef SUBREM_LIGHT scene_manager_set_scene_state( app->scene_manager, SubRemSceneStart, SubmenuIndexSubRemOpenMapFile); +#endif scene_manager_next_scene(app->scene_manager, SubRemSceneOpenMapFile); consumed = true; } diff --git a/applications/main/subghz_remote/subghz_remote_app_i.c b/applications/main/subghz_remote/subghz_remote_app_i.c index 82c2efbf5..121fbf787 100644 --- a/applications/main/subghz_remote/subghz_remote_app_i.c +++ b/applications/main/subghz_remote/subghz_remote_app_i.c @@ -252,11 +252,11 @@ bool subrem_tx_stop_sub(SubGhzRemoteApp* app, bool forced) { if(sub_preset->type == SubGhzProtocolTypeDynamic) { keeloq_reset_mfname(); keeloq_reset_kl_type(); - keeloq_reset_original_btn(); - subghz_custom_btns_reset(); star_line_reset_mfname(); star_line_reset_kl_type(); } + keeloq_reset_original_btn(); + subghz_custom_btns_reset(); #endif return true; } diff --git a/applications/main/subghz_remote/subghz_remote_app_i.h b/applications/main/subghz_remote/subghz_remote_app_i.h index ff01ba12a..1ced74d11 100644 --- a/applications/main/subghz_remote/subghz_remote_app_i.h +++ b/applications/main/subghz_remote/subghz_remote_app_i.h @@ -8,7 +8,7 @@ #ifdef APP_SUBGHZREMOTE #include -#elif +#else #include #endif