summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/main_menu.c4
-rw-r--r--apps/menu.c21
2 files changed, 18 insertions, 7 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c
index df9350ad5a..e53832a42c 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -76,9 +76,9 @@ static int show_logo(void)
76void show_splash(void) 76void show_splash(void)
77{ 77{
78 lcd_clear_display(); 78 lcd_clear_display();
79 79
80 if (show_logo() != 0) 80 if (show_logo() != 0)
81 return; 81 return;
82} 82}
83 83
84void version(void) 84void version(void)
diff --git a/apps/menu.c b/apps/menu.c
index e359f75799..a863925eca 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -55,6 +55,10 @@ static void menu_draw(int m)
55 i++) { 55 i++) {
56 lcd_puts(1, i-menus[m].top, menus[m].items[i].desc); 56 lcd_puts(1, i-menus[m].top, menus[m].items[i].desc);
57 } 57 }
58
59 /* place the cursor */
60 lcd_puts(0, menus[m].cursor - menus[m].top, "-");
61
58 lcd_update(); 62 lcd_update();
59} 63}
60 64
@@ -64,18 +68,27 @@ static void menu_draw(int m)
64 */ 68 */
65static void put_cursor(int m, int target) 69static void put_cursor(int m, int target)
66{ 70{
67 lcd_puts(0, menus[m].cursor - menus[m].top, " "); 71 bool do_update = true;
72
73 lcd_puts(0, menus[m].cursor - menus[m].top, " ");
74 menus[m].cursor = target;
68 75
69 if ( target < menus[m].top ) { 76 if ( target < menus[m].top ) {
70 menus[m].top--; 77 menus[m].top--;
71 menu_draw(m); 78 menu_draw(m);
79 do_update = false;
72 } 80 }
73 else if ( target-menus[m].top > MENU_LINES-1 ) { 81 else if ( target-menus[m].top > MENU_LINES-1 ) {
74 menus[m].top++; 82 menus[m].top++;
75 menu_draw(m); 83 menu_draw(m);
84 do_update = false;
76 } 85 }
77 menus[m].cursor = target; 86
78 lcd_puts(0, menus[m].cursor - menus[m].top, "-"); 87 if (do_update) {
88 lcd_puts(0, menus[m].cursor - menus[m].top, "-");
89 lcd_update();
90 }
91
79} 92}
80 93
81int menu_init(struct menu_items* mitems, int count) 94int menu_init(struct menu_items* mitems, int count)
@@ -108,7 +121,6 @@ void menu_exit(int m)
108void menu_run(int m) 121void menu_run(int m)
109{ 122{
110 menu_draw(m); 123 menu_draw(m);
111 lcd_puts(0, menus[m].cursor - menus[m].top, "-");
112 124
113 while(1) { 125 while(1) {
114 switch( button_get(true) ) { 126 switch( button_get(true) ) {
@@ -145,7 +157,6 @@ void menu_run(int m)
145 157
146 /* Return to previous display state */ 158 /* Return to previous display state */
147 menu_draw(m); 159 menu_draw(m);
148 lcd_puts(0, menus[m].cursor - menus[m].top, "-");
149 break; 160 break;
150 161
151#ifdef HAVE_RECORDER_KEYPAD 162#ifdef HAVE_RECORDER_KEYPAD