Skip to content

Commit

Permalink
Picopass: allow write immediately after read (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <alleteam@gmail.com>
  • Loading branch information
bettse and skotopes authored Aug 22, 2023
1 parent 9589140 commit 2bf8d61
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scenes/picopass_scene_card_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ enum SubmenuIndex {
SubmenuIndexSave,
SubmenuIndexSaveAsLF,
SubmenuIndexChangeKey,
SubmenuIndexWrite,
SubmenuIndexEmulate,
};

void picopass_scene_card_menu_submenu_callback(void* context, uint32_t index) {
Expand All @@ -26,6 +28,14 @@ void picopass_scene_card_menu_on_enter(void* context) {
picopass_scene_card_menu_submenu_callback,
picopass);
}
submenu_add_item(
submenu, "Write", SubmenuIndexWrite, picopass_scene_card_menu_submenu_callback, picopass);
submenu_add_item(
submenu,
"Emulate",
SubmenuIndexEmulate,
picopass_scene_card_menu_submenu_callback,
picopass);
submenu_add_item(
submenu,
"Change Key",
Expand Down Expand Up @@ -57,6 +67,12 @@ bool picopass_scene_card_menu_on_event(void* context, SceneManagerEvent event) {
picopass->dev->format = PicopassDeviceSaveFormatLF;
scene_manager_next_scene(picopass->scene_manager, PicopassSceneSaveName);
consumed = true;
} else if(event.event == SubmenuIndexWrite) {
scene_manager_next_scene(picopass->scene_manager, PicopassSceneWriteCard);
consumed = true;
} else if(event.event == SubmenuIndexEmulate) {
scene_manager_next_scene(picopass->scene_manager, PicopassSceneEmulate);
consumed = true;
} else if(event.event == SubmenuIndexChangeKey) {
scene_manager_set_scene_state(
picopass->scene_manager, PicopassSceneCardMenu, SubmenuIndexChangeKey);
Expand Down

0 comments on commit 2bf8d61

Please sign in to comment.