forked from flipperdevices/flipperzero-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- UI / Scenes - by @xMasterX - Poller functions, minor UI fixes - by @Leptopt1los
- Loading branch information
Showing
17 changed files
with
776 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
base_pack/nfc_magic/scenes/nfc_magic_scene_gen4_actions_menu.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include "../nfc_magic_app_i.h" | ||
#include "furi_hal_rtc.h" | ||
|
||
enum SubmenuIndex { | ||
SubmenuIndexAuthenticate, | ||
SubmenuIndexSetStandartConfig, | ||
SubmenuIndexGetRevision, | ||
SubmenuIndexGetConfig | ||
}; | ||
|
||
void nfc_magic_scene_gen4_actions_menu_submenu_callback(void* context, uint32_t index) { | ||
NfcMagicApp* instance = context; | ||
|
||
view_dispatcher_send_custom_event(instance->view_dispatcher, index); | ||
} | ||
|
||
void nfc_magic_scene_gen4_actions_menu_on_enter(void* context) { | ||
NfcMagicApp* instance = context; | ||
|
||
Submenu* submenu = instance->submenu; | ||
submenu_add_item( | ||
submenu, | ||
"Auth With Password", | ||
SubmenuIndexAuthenticate, | ||
nfc_magic_scene_gen4_actions_menu_submenu_callback, | ||
instance); | ||
submenu_add_item( | ||
submenu, | ||
"Set Standart Config", | ||
SubmenuIndexSetStandartConfig, | ||
nfc_magic_scene_gen4_actions_menu_submenu_callback, | ||
instance); | ||
submenu_add_item( | ||
submenu, | ||
"Get Revision", | ||
SubmenuIndexGetRevision, | ||
nfc_magic_scene_gen4_actions_menu_submenu_callback, | ||
instance); | ||
if(furi_hal_rtc_is_flag_set(FuriHalRtcFlagDebug)) { | ||
submenu_add_item( | ||
submenu, | ||
"Get Config", | ||
SubmenuIndexGetConfig, | ||
nfc_magic_scene_gen4_actions_menu_submenu_callback, | ||
instance); | ||
} | ||
|
||
submenu_set_selected_item( | ||
submenu, | ||
scene_manager_get_scene_state(instance->scene_manager, NfcMagicSceneGen4ActionsMenu)); | ||
view_dispatcher_switch_to_view(instance->view_dispatcher, NfcMagicAppViewMenu); | ||
} | ||
|
||
bool nfc_magic_scene_gen4_actions_menu_on_event(void* context, SceneManagerEvent event) { | ||
NfcMagicApp* instance = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == SubmenuIndexAuthenticate) { | ||
scene_manager_next_scene(instance->scene_manager, NfcMagicSceneKeyInput); | ||
consumed = true; | ||
} else if(event.event == SubmenuIndexSetStandartConfig) { | ||
scene_manager_next_scene(instance->scene_manager, NfcMagicSceneGen4SetCFG); | ||
consumed = true; | ||
} else if(event.event == SubmenuIndexGetRevision) { | ||
scene_manager_next_scene(instance->scene_manager, NfcMagicSceneGen4Revision); | ||
consumed = true; | ||
} else if(event.event == SubmenuIndexGetConfig) { | ||
scene_manager_next_scene(instance->scene_manager, NfcMagicSceneGen4GetCFG); | ||
consumed = true; | ||
} | ||
scene_manager_set_scene_state( | ||
instance->scene_manager, NfcMagicSceneGen4ActionsMenu, event.event); | ||
} else if(event.type == SceneManagerEventTypeBack) { | ||
consumed = scene_manager_search_and_switch_to_previous_scene( | ||
instance->scene_manager, NfcMagicSceneStart); | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void nfc_magic_scene_gen4_actions_menu_on_exit(void* context) { | ||
NfcMagicApp* instance = context; | ||
|
||
submenu_reset(instance->submenu); | ||
} |
Oops, something went wrong.