Rev 1529 | Rev 1591 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1529 | Rev 1583 | ||
---|---|---|---|
Line 112... | Line 112... | ||
112 | }; |
112 | }; |
Line 113... | Line 113... | ||
113 | 113 | ||
114 | // ----------------------------------------------------------- |
114 | // ----------------------------------------------------------- |
115 | // Update display buffer |
115 | // Update display buffer |
116 | // ----------------------------------------------------------- |
116 | // ----------------------------------------------------------- |
117 | void JetiBox_Update(unsigned char key) |
117 | unsigned char JetiBox_Update(unsigned char key) |
118 | { |
118 | { |
Line 119... | Line 119... | ||
119 | static uint8_t item = 0, last_item = 0; // the menu item |
119 | static uint8_t item = 0, last_item = 0; // the menu item |
120 | 120 | ||
121 | // navigate within the menu by key action |
121 | // navigate within the menu by key action |
122 | last_item = item; |
122 | last_item = item; |
123 | switch(key) |
123 | switch(key) |
- | 124 | { |
|
124 | { |
125 | case JETIBOX_KEY_LEFT: |
125 | case JETIBOX_KEY_LEFT: |
126 | if (item == 0) return (1); // switch back to jeti expander menu |
126 | item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
127 | else item = pgm_read_byte(&JetiBox_Menu[item].left); //trigger to left menu item |
127 | break; |
128 | break; |
128 | case JETIBOX_KEY_RIGHT: |
129 | case JETIBOX_KEY_RIGHT: |
129 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
130 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
Line 142... | Line 143... | ||
142 | if(item != last_item) key = JETIBOX_KEY_UNDEF; |
143 | if(item != last_item) key = JETIBOX_KEY_UNDEF; |
Line 143... | Line 144... | ||
143 | 144 | ||
144 | LIBFC_JetiBox_Clear(); |
145 | LIBFC_JetiBox_Clear(); |
145 | //execute menu item handler |
146 | //execute menu item handler |
- | 147 | ((pFctMenu)(pgm_read_word(&(JetiBox_Menu[item].pHandler))))(key); |
|
- | 148 | ||
146 | ((pFctMenu)(pgm_read_word(&(JetiBox_Menu[item].pHandler))))(key); |
149 | return (0); |