1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 13:09:49 +04:00

Same codebase as fap

This commit is contained in:
gid9798
2023-05-30 17:41:49 +03:00
parent b3e8b2c487
commit a312aa422a
7 changed files with 21 additions and 34 deletions

View File

@@ -12,6 +12,6 @@ App(
"dialogs",
],
icon="A_SubGHzRemote_14",
stack_size=3 * 1024,
stack_size=2 * 1024,
order=11,
)

View File

@@ -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)

View File

@@ -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);
}
}
}

View File

@@ -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(

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -8,7 +8,7 @@
#ifdef APP_SUBGHZREMOTE
#include <assets_icons.h>
#elif
#else
#include <subrem_remote_fap_icons.h>
#endif