Skip to content

Commit

Permalink
Unused params nanos (#161)
Browse files Browse the repository at this point in the history
* Use z_unused macro on unused params

* Bump version
  • Loading branch information
0xPxt authored Dec 16, 2024
1 parent 02f8d37 commit fec0d14
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions app/ui/view_s.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void os_exit(uint32_t id) {
(void)id;
os_sched_exit(0);
}
static unsigned int view_skip_button(unsigned int button_mask, __Z_UNUSED unsigned int button_mask_counter);
const bagl_element_t *view_prepro(const bagl_element_t *element);

// Add new view state for skip screen
Expand Down Expand Up @@ -237,6 +238,37 @@ bool should_show_skip_menu_left() {
!is_in_skip_menu;
}

static unsigned int view_review_button(unsigned int button_mask, __Z_UNUSED unsigned int button_mask_counter) {
switch (button_mask) {
case BUTTON_EVT_RELEASED | BUTTON_LEFT | BUTTON_RIGHT:
// Only handle double-click if we're in skip menu or approve/reject screens
if (is_in_skip_menu || is_accept_item() || is_reject_item()) {
h_review_button_both();
}
break;
case BUTTON_EVT_RELEASED | BUTTON_LEFT:
// Check if we should show skip menu before moving back
if (should_show_skip_menu_left()) {
is_in_skip_menu = true;
UX_DISPLAY(view_skip, view_prepro);
} else {
is_in_skip_menu = false;
h_review_button_left();
}
break;
case BUTTON_EVT_RELEASED | BUTTON_RIGHT:
if (should_show_skip_menu_right()) {
is_in_skip_menu = true; // Entering skip menu
UX_DISPLAY(view_skip, view_prepro);
} else {
is_in_skip_menu = false;
h_review_button_right();
}
break;
}
return 0;
}

const bagl_element_t* idle_preprocessor(__Z_UNUSED const ux_menu_entry_t* entry, bagl_element_t* element) {
switch(ux_menu.current_entry) {
case SCREEN_HOME:
Expand Down Expand Up @@ -556,4 +588,24 @@ bool exceed_pixel_in_display(const uint8_t length) {
return (strWidth >= (BAGL_WIDTH - BAGL_WIDTH_MARGIN));
}

static unsigned int view_skip_button(unsigned int button_mask, __Z_UNUSED unsigned int button_mask_counter) {
switch (button_mask) {
case BUTTON_EVT_RELEASED | BUTTON_LEFT | BUTTON_RIGHT:
// Skip to approve
h_review_action(review_type);
break;
case BUTTON_EVT_RELEASED | BUTTON_RIGHT:
// Continue review
is_in_skip_menu = false;
h_review_button_right();
break;
case BUTTON_EVT_RELEASED | BUTTON_LEFT:
// Go back
is_in_skip_menu = false;
h_review_button_left();
break;
}
return 0;
}

#endif
2 changes: 1 addition & 1 deletion include/zxversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

#define ZXLIB_MAJOR 30
#define ZXLIB_MINOR 1
#define ZXLIB_PATCH 2
#define ZXLIB_PATCH 3

0 comments on commit fec0d14

Please sign in to comment.