Skip to content

No wrap around for Jump tables #2597

Answered by olikraus
SergeTauger asked this question in Q&A
Discussion options

You must be logged in to vote

The simple answer is, use this code instead of mui_u8g2_u16_list_goto_w1_pi:

uint8_t my_u16_list_goto_w1_pi(mui_t *ui, uint8_t msg)
{
uint8_t arg = ui->arg; /* arg provided with MUI_XYA() */
switch(msg)
{
case MUIF_MSG_EVENT_NEXT:
if ( arg+1 == ui->form_scroll_visible )
{
if ( ui->form_scroll_visible + ui->form_scroll_top < ui->form_scroll_total )
{
ui->form_scroll_top++;
return 1;
}
else
{
/* no wrap around to the top */
return 1;
/*
ui->form_scroll_top = 0;
*/
}
}
break;
case MUIF_MSG_EVENT_PREV:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SergeTauger
Comment options

Answer selected by SergeTauger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants