diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-08-15 12:27:07 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-08-15 12:27:07 +0000 |
commit | 224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9 (patch) | |
tree | bae2154b272f786983cf8e6de28d33f98f327560 /apps/debug_menu.c | |
parent | c0f8b187706364f5e4bda2ac26750d14454c901d (diff) | |
download | rockbox-224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9.tar.gz rockbox-224c0a13ebb5828b9bc06a9c1c23ae17f0ac19f9.zip |
Finally, the new button action system is here, thanks to Jonathan Gordon. Some button mappings have changed and other things may break. Comments should go to the forum, http://forums.rockbox.org/index.php?topic=5829.0 or the mailing list.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10582 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 244 |
1 files changed, 85 insertions, 159 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index e79e88de76..469660cbd0 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include "debug_menu.h" | 27 | #include "debug_menu.h" |
28 | #include "kernel.h" | 28 | #include "kernel.h" |
29 | #include "sprintf.h" | 29 | #include "sprintf.h" |
30 | #include "button.h" | 30 | #include "action.h" |
31 | #include "adc.h" | 31 | #include "adc.h" |
32 | #include "mas.h" | 32 | #include "mas.h" |
33 | #include "power.h" | 33 | #include "power.h" |
@@ -86,7 +86,6 @@ extern const char *thread_name[]; | |||
86 | bool dbg_os(void) | 86 | bool dbg_os(void) |
87 | { | 87 | { |
88 | char buf[32]; | 88 | char buf[32]; |
89 | int button; | ||
90 | int i; | 89 | int i; |
91 | int usage; | 90 | int usage; |
92 | 91 | ||
@@ -106,13 +105,8 @@ bool dbg_os(void) | |||
106 | 105 | ||
107 | lcd_update(); | 106 | lcd_update(); |
108 | 107 | ||
109 | button = button_get_w_tmo(HZ/10); | 108 | if (action_userabort(TIMEOUT_BLOCK)) |
110 | 109 | return false; | |
111 | switch(button) | ||
112 | { | ||
113 | case SETTINGS_CANCEL: | ||
114 | return false; | ||
115 | } | ||
116 | } | 110 | } |
117 | return false; | 111 | return false; |
118 | } | 112 | } |
@@ -134,20 +128,21 @@ bool dbg_os(void) | |||
134 | snprintf(buf, 32, "%d: %d%% ", currval, usage); | 128 | snprintf(buf, 32, "%d: %d%% ", currval, usage); |
135 | lcd_puts(0, 1, buf); | 129 | lcd_puts(0, 1, buf); |
136 | 130 | ||
137 | button = button_get_w_tmo(HZ/10); | 131 | button = get_action(CONTEXT_SETTINGS,HZ/10); |
138 | 132 | ||
139 | switch(button) | 133 | switch(button) |
140 | { | 134 | { |
141 | case SETTINGS_CANCEL: | 135 | case ACTION_STD_CANCEL: |
136 | action_signalscreenchange(); | ||
142 | return false; | 137 | return false; |
143 | 138 | ||
144 | case SETTINGS_DEC: | 139 | case ACTION_SETTINGS_DEC: |
145 | currval--; | 140 | currval--; |
146 | if(currval < 0) | 141 | if(currval < 0) |
147 | currval = num_threads-1; | 142 | currval = num_threads-1; |
148 | break; | 143 | break; |
149 | 144 | ||
150 | case SETTINGS_INC: | 145 | case ACTION_SETTINGS_INC: |
151 | currval++; | 146 | currval++; |
152 | if(currval > num_threads-1) | 147 | if(currval > num_threads-1) |
153 | currval = 0; | 148 | currval = 0; |
@@ -163,7 +158,6 @@ bool dbg_os(void) | |||
163 | bool dbg_audio_thread(void) | 158 | bool dbg_audio_thread(void) |
164 | { | 159 | { |
165 | char buf[32]; | 160 | char buf[32]; |
166 | int button; | ||
167 | struct audio_debug d; | 161 | struct audio_debug d; |
168 | 162 | ||
169 | lcd_setmargins(0, 0); | 163 | lcd_setmargins(0, 0); |
@@ -171,12 +165,8 @@ bool dbg_audio_thread(void) | |||
171 | 165 | ||
172 | while(1) | 166 | while(1) |
173 | { | 167 | { |
174 | button = button_get_w_tmo(HZ/5); | 168 | if (action_userabort(HZ/5)) |
175 | switch(button) | 169 | return false; |
176 | { | ||
177 | case SETTINGS_CANCEL: | ||
178 | return false; | ||
179 | } | ||
180 | 170 | ||
181 | audio_get_debugdata(&d); | 171 | audio_get_debugdata(&d); |
182 | 172 | ||
@@ -242,23 +232,22 @@ bool dbg_audio_thread(void) | |||
242 | 232 | ||
243 | lcd_setmargins(0, 0); | 233 | lcd_setmargins(0, 0); |
244 | lcd_setfont(FONT_SYSFIXED); | 234 | lcd_setfont(FONT_SYSFIXED); |
245 | |||
246 | while(!done) | 235 | while(!done) |
247 | { | 236 | { |
248 | button = button_get_w_tmo(HZ/5); | 237 | button = get_action(CONTEXT_STD,HZ/5); |
249 | switch(button) | 238 | switch(button) |
250 | { | 239 | { |
251 | case SETTINGS_NEXT: | 240 | case ACTION_STD_NEXT: |
252 | audio_next(); | 241 | audio_next(); |
253 | break; | 242 | break; |
254 | case SETTINGS_PREV: | 243 | case ACTION_STD_PREV: |
255 | audio_prev(); | 244 | audio_prev(); |
256 | break; | 245 | break; |
257 | case SETTINGS_CANCEL: | 246 | case ACTION_STD_CANCEL: |
258 | done = true; | 247 | done = true; |
259 | break; | 248 | break; |
260 | } | 249 | } |
261 | 250 | action_signalscreenchange(); | |
262 | line = 0; | 251 | line = 0; |
263 | 252 | ||
264 | lcd_clear_display(); | 253 | lcd_clear_display(); |
@@ -406,7 +395,6 @@ bool dbg_hw_info(void) | |||
406 | { | 395 | { |
407 | #if CONFIG_CPU == SH7034 | 396 | #if CONFIG_CPU == SH7034 |
408 | char buf[32]; | 397 | char buf[32]; |
409 | int button; | ||
410 | int usb_polarity; | 398 | int usb_polarity; |
411 | int pr_polarity; | 399 | int pr_polarity; |
412 | int bitmask = *(unsigned short*)0x20000fc; | 400 | int bitmask = *(unsigned short*)0x20000fc; |
@@ -494,13 +482,11 @@ bool dbg_hw_info(void) | |||
494 | 482 | ||
495 | while(1) | 483 | while(1) |
496 | { | 484 | { |
497 | button = button_get(true); | 485 | if (action_userabort(TIMEOUT_BLOCK)) |
498 | if(button == SETTINGS_CANCEL) | ||
499 | return false; | 486 | return false; |
500 | } | 487 | } |
501 | #elif CONFIG_CPU == MCF5249 || CONFIG_CPU == MCF5250 | 488 | #elif CONFIG_CPU == MCF5249 || CONFIG_CPU == MCF5250 |
502 | char buf[32]; | 489 | char buf[32]; |
503 | int button; | ||
504 | unsigned manu, id; /* flash IDs */ | 490 | unsigned manu, id; /* flash IDs */ |
505 | bool got_id; /* flag if we managed to get the flash IDs */ | 491 | bool got_id; /* flag if we managed to get the flash IDs */ |
506 | int oldmode; /* saved memory guard mode */ | 492 | int oldmode; /* saved memory guard mode */ |
@@ -530,13 +516,11 @@ bool dbg_hw_info(void) | |||
530 | 516 | ||
531 | while(1) | 517 | while(1) |
532 | { | 518 | { |
533 | button = button_get(true); | 519 | if (action_userabort(TIMEOUT_BLOCK)) |
534 | if(button == SETTINGS_CANCEL) | ||
535 | return false; | 520 | return false; |
536 | } | 521 | } |
537 | #elif CONFIG_CPU == PP5020 | 522 | #elif CONFIG_CPU == PP5020 |
538 | char buf[32]; | 523 | char buf[32]; |
539 | int button; | ||
540 | 524 | ||
541 | lcd_setmargins(0, 0); | 525 | lcd_setmargins(0, 0); |
542 | lcd_setfont(FONT_SYSFIXED); | 526 | lcd_setfont(FONT_SYSFIXED); |
@@ -551,8 +535,7 @@ bool dbg_hw_info(void) | |||
551 | 535 | ||
552 | while(1) | 536 | while(1) |
553 | { | 537 | { |
554 | button = button_get(true); | 538 | if (action_userabort(TIMEOUT_BLOCK)) |
555 | if(button == SETTINGS_CANCEL) | ||
556 | return false; | 539 | return false; |
557 | } | 540 | } |
558 | #endif /* CONFIG_CPU */ | 541 | #endif /* CONFIG_CPU */ |
@@ -641,20 +624,21 @@ bool dbg_hw_info(void) | |||
641 | lcd_puts(0, 1, buf); | 624 | lcd_puts(0, 1, buf); |
642 | lcd_update(); | 625 | lcd_update(); |
643 | 626 | ||
644 | button = button_get(true); | 627 | button = get_action(CONTEXT_SETTINGS,TIMEOUT_BLOCK); |
645 | 628 | ||
646 | switch(button) | 629 | switch(button) |
647 | { | 630 | { |
648 | case SETTINGS_CANCEL: | 631 | case ACTION_STD_CANCEL: |
632 | action_signalscreenchange(); | ||
649 | return false; | 633 | return false; |
650 | 634 | ||
651 | case SETTINGS_DEC: | 635 | case ACTION_SETTINGS_DEC: |
652 | currval--; | 636 | currval--; |
653 | if(currval < 0) | 637 | if(currval < 0) |
654 | currval = 5; | 638 | currval = 5; |
655 | break; | 639 | break; |
656 | 640 | ||
657 | case SETTINGS_INC: | 641 | case ACTION_SETTINGS_INC: |
658 | currval++; | 642 | currval++; |
659 | if(currval > 5) | 643 | if(currval > 5) |
660 | currval = 0; | 644 | currval = 0; |
@@ -688,21 +672,21 @@ bool dbg_partitions(void) | |||
688 | lcd_puts(0, 1, buf); | 672 | lcd_puts(0, 1, buf); |
689 | lcd_update(); | 673 | lcd_update(); |
690 | 674 | ||
691 | button = button_get(true); | 675 | button = get_action(CONTEXT_SETTINGS,TIMEOUT_BLOCK); |
692 | 676 | ||
693 | switch(button) | 677 | switch(button) |
694 | { | 678 | { |
695 | case SETTINGS_OK: | 679 | case ACTION_STD_CANCEL: |
696 | case SETTINGS_CANCEL: | 680 | action_signalscreenchange(); |
697 | return false; | 681 | return false; |
698 | 682 | ||
699 | case SETTINGS_DEC: | 683 | case ACTION_SETTINGS_DEC: |
700 | partition--; | 684 | partition--; |
701 | if (partition < 0) | 685 | if (partition < 0) |
702 | partition = 3; | 686 | partition = 3; |
703 | break; | 687 | break; |
704 | 688 | ||
705 | case SETTINGS_INC: | 689 | case ACTION_SETTINGS_INC: |
706 | partition++; | 690 | partition++; |
707 | if (partition > 3) | 691 | if (partition > 3) |
708 | partition = 0; | 692 | partition = 0; |
@@ -874,13 +858,8 @@ bool dbg_spdif(void) | |||
874 | 858 | ||
875 | lcd_update(); | 859 | lcd_update(); |
876 | 860 | ||
877 | switch (button_get_w_tmo(HZ/10)) | 861 | if (action_userabort(HZ/2)) |
878 | { | 862 | return false; |
879 | case SETTINGS_CANCEL: | ||
880 | case SETTINGS_OK2: | ||
881 | done = true; | ||
882 | break; | ||
883 | } | ||
884 | } | 863 | } |
885 | #ifdef HAVE_SPDIF_POWER | 864 | #ifdef HAVE_SPDIF_POWER |
886 | spdif_power_enable(global_settings.spdif_enable); | 865 | spdif_power_enable(global_settings.spdif_enable); |
@@ -940,13 +919,8 @@ bool dbg_ports(void) | |||
940 | lcd_puts(0, 7, buf); | 919 | lcd_puts(0, 7, buf); |
941 | #endif | 920 | #endif |
942 | lcd_update(); | 921 | lcd_update(); |
943 | button = button_get_w_tmo(HZ/10); | 922 | if (action_userabort(HZ/10)) |
944 | 923 | return false; | |
945 | switch(button) | ||
946 | { | ||
947 | case SETTINGS_CANCEL: | ||
948 | return false; | ||
949 | } | ||
950 | } | 924 | } |
951 | #elif defined(CPU_COLDFIRE) | 925 | #elif defined(CPU_COLDFIRE) |
952 | unsigned int gpio_out; | 926 | unsigned int gpio_out; |
@@ -962,7 +936,6 @@ bool dbg_ports(void) | |||
962 | int adc_remotedetect; | 936 | int adc_remotedetect; |
963 | #endif | 937 | #endif |
964 | char buf[128]; | 938 | char buf[128]; |
965 | int button; | ||
966 | int line; | 939 | int line; |
967 | int battery_voltage; | 940 | int battery_voltage; |
968 | int batt_int, batt_frac; | 941 | int batt_int, batt_frac; |
@@ -1033,13 +1006,8 @@ bool dbg_ports(void) | |||
1033 | #endif | 1006 | #endif |
1034 | 1007 | ||
1035 | lcd_update(); | 1008 | lcd_update(); |
1036 | button = button_get_w_tmo(HZ/10); | 1009 | if (action_userabort(HZ/10)) |
1037 | 1010 | return false; | |
1038 | switch(button) | ||
1039 | { /* quit on release to allow for reading the cancel button input */ | ||
1040 | case (SETTINGS_CANCEL|BUTTON_REL): | ||
1041 | return false; | ||
1042 | } | ||
1043 | } | 1011 | } |
1044 | 1012 | ||
1045 | #elif CONFIG_CPU == PP5020 | 1013 | #elif CONFIG_CPU == PP5020 |
@@ -1049,7 +1017,6 @@ bool dbg_ports(void) | |||
1049 | unsigned int gpio_i, gpio_j, gpio_k, gpio_l; | 1017 | unsigned int gpio_i, gpio_j, gpio_k, gpio_l; |
1050 | 1018 | ||
1051 | char buf[128]; | 1019 | char buf[128]; |
1052 | int button; | ||
1053 | int line; | 1020 | int line; |
1054 | 1021 | ||
1055 | lcd_setmargins(0, 0); | 1022 | lcd_setmargins(0, 0); |
@@ -1091,13 +1058,8 @@ bool dbg_ports(void) | |||
1091 | lcd_puts(0, line++, buf); | 1058 | lcd_puts(0, line++, buf); |
1092 | 1059 | ||
1093 | lcd_update(); | 1060 | lcd_update(); |
1094 | button = button_get_w_tmo(HZ/10); | 1061 | if (action_userabort(HZ/10)) |
1095 | 1062 | return false; | |
1096 | switch(button) | ||
1097 | { | ||
1098 | case SETTINGS_CANCEL: | ||
1099 | return false; | ||
1100 | } | ||
1101 | } | 1063 | } |
1102 | 1064 | ||
1103 | #endif /* CPU */ | 1065 | #endif /* CPU */ |
@@ -1170,20 +1132,21 @@ bool dbg_ports(void) | |||
1170 | snprintf(buf, 32, "Batt: %d.%02dV", batt_int, batt_frac); | 1132 | snprintf(buf, 32, "Batt: %d.%02dV", batt_int, batt_frac); |
1171 | lcd_puts(0, 1, buf); | 1133 | lcd_puts(0, 1, buf); |
1172 | 1134 | ||
1173 | button = button_get_w_tmo(HZ/5); | 1135 | button = get_action(CONTEXT_SETTINGS,HZ/5); |
1174 | 1136 | ||
1175 | switch(button) | 1137 | switch(button) |
1176 | { | 1138 | { |
1177 | case SETTINGS_CANCEL: | 1139 | case ACTION_STD_CANCEL: |
1140 | action_signalscreenchange(); | ||
1178 | return false; | 1141 | return false; |
1179 | 1142 | ||
1180 | case SETTINGS_DEC: | 1143 | case ACTION_SETTINGS_DEC: |
1181 | currval--; | 1144 | currval--; |
1182 | if(currval < 0) | 1145 | if(currval < 0) |
1183 | currval = 10; | 1146 | currval = 10; |
1184 | break; | 1147 | break; |
1185 | 1148 | ||
1186 | case SETTINGS_INC: | 1149 | case ACTION_SETTINGS_INC: |
1187 | currval++; | 1150 | currval++; |
1188 | if(currval > 10) | 1151 | if(currval > 10) |
1189 | currval = 0; | 1152 | currval = 0; |
@@ -1219,43 +1182,25 @@ bool dbg_cpufreq(void) | |||
1219 | lcd_puts(0, line++, buf); | 1182 | lcd_puts(0, line++, buf); |
1220 | 1183 | ||
1221 | lcd_update(); | 1184 | lcd_update(); |
1222 | button = button_get_w_tmo(HZ/10); | 1185 | button = get_action(CONTEXT_STD,HZ/10); |
1223 | 1186 | ||
1224 | switch(button) | 1187 | switch(button) |
1225 | { | 1188 | { |
1226 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) | 1189 | case ACTION_STD_PREV: |
1227 | case BUTTON_MENU: | 1190 | cpu_boost(true); |
1228 | #else | 1191 | break; |
1229 | case BUTTON_UP: | 1192 | case ACTION_STD_NEXT: |
1230 | #endif | 1193 | cpu_boost(false); |
1231 | cpu_boost(true); | 1194 | break; |
1232 | break; | ||
1233 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) | ||
1234 | case BUTTON_PLAY: | ||
1235 | #else | ||
1236 | case BUTTON_DOWN: | ||
1237 | #endif | ||
1238 | cpu_boost(false); | ||
1239 | break; | ||
1240 | 1195 | ||
1241 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | 1196 | case ACTION_STD_OK: |
1242 | (CONFIG_KEYPAD == IRIVER_H300_PAD) || \ | 1197 | set_cpu_frequency(CPUFREQ_DEFAULT); |
1243 | (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) | 1198 | boost_counter = 0; |
1244 | case BUTTON_SELECT: | 1199 | break; |
1245 | #else | ||
1246 | case BUTTON_PLAY: | ||
1247 | #endif | ||
1248 | set_cpu_frequency(CPUFREQ_DEFAULT); | ||
1249 | boost_counter = 0; | ||
1250 | break; | ||
1251 | 1200 | ||
1252 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) | 1201 | case ACTION_STD_CANCEL: |
1253 | case BUTTON_LEFT: | 1202 | action_signalscreenchange(); |
1254 | #else | 1203 | return false; |
1255 | case SETTINGS_CANCEL: | ||
1256 | case SETTINGS_OK2: | ||
1257 | #endif | ||
1258 | return false; | ||
1259 | } | 1204 | } |
1260 | } | 1205 | } |
1261 | 1206 | ||
@@ -1428,20 +1373,20 @@ bool view_battery(void) | |||
1428 | 1373 | ||
1429 | lcd_update(); | 1374 | lcd_update(); |
1430 | 1375 | ||
1431 | switch(button_get_w_tmo(HZ/2)) | 1376 | switch(get_action(CONTEXT_SETTINGS,HZ/2)) |
1432 | { | 1377 | { |
1433 | case SETTINGS_DEC: | 1378 | case ACTION_SETTINGS_DEC: |
1434 | if (view) | 1379 | if (view) |
1435 | view--; | 1380 | view--; |
1436 | break; | 1381 | break; |
1437 | 1382 | ||
1438 | case SETTINGS_INC: | 1383 | case ACTION_SETTINGS_INC: |
1439 | if (view < 3) | 1384 | if (view < 3) |
1440 | view++; | 1385 | view++; |
1441 | break; | 1386 | break; |
1442 | 1387 | ||
1443 | case SETTINGS_OK: | 1388 | case ACTION_STD_CANCEL: |
1444 | case SETTINGS_CANCEL: | 1389 | action_signalscreenchange(); |
1445 | return false; | 1390 | return false; |
1446 | } | 1391 | } |
1447 | } | 1392 | } |
@@ -1498,41 +1443,40 @@ static bool view_runtime(void) | |||
1498 | lcd_update(); | 1443 | lcd_update(); |
1499 | 1444 | ||
1500 | /* Wait for a key to be pushed */ | 1445 | /* Wait for a key to be pushed */ |
1501 | key = button_get_w_tmo(HZ); | 1446 | key = get_action(CONTEXT_SETTINGS,HZ); |
1502 | switch(key) { | 1447 | switch(key) { |
1503 | case SETTINGS_CANCEL: | 1448 | case ACTION_STD_CANCEL: |
1504 | done = true; | 1449 | done = true; |
1505 | break; | 1450 | break; |
1506 | 1451 | ||
1507 | case SETTINGS_INC: | 1452 | case ACTION_SETTINGS_INC: |
1508 | case SETTINGS_DEC: | 1453 | case ACTION_SETTINGS_DEC: |
1509 | if (state == 1) | 1454 | if (state == 1) |
1510 | state = 2; | 1455 | state = 2; |
1511 | else | 1456 | else |
1512 | state = 1; | 1457 | state = 1; |
1513 | break; | 1458 | break; |
1514 | 1459 | ||
1515 | case SETTINGS_OK: | 1460 | case ACTION_STD_OK: |
1516 | lcd_clear_display(); | 1461 | lcd_clear_display(); |
1462 | /*NOTE: this needs to be changed to sync splash! */ | ||
1517 | lcd_puts(0,0,"Clear time?"); | 1463 | lcd_puts(0,0,"Clear time?"); |
1518 | lcd_puts(0,1,"PLAY = Yes"); | 1464 | lcd_puts(0,1,"PLAY = Yes"); |
1519 | lcd_update(); | 1465 | lcd_update(); |
1520 | while (1) { | 1466 | while (1) { |
1521 | key = button_get(true); | 1467 | key = get_action(CONTEXT_STD,TIMEOUT_BLOCK); |
1522 | if ( key == SETTINGS_OK ) { | 1468 | if ( key == ACTION_STD_OK ) { |
1523 | if ( state == 1 ) | 1469 | if ( state == 1 ) |
1524 | global_settings.runtime = 0; | 1470 | global_settings.runtime = 0; |
1525 | else | 1471 | else |
1526 | global_settings.topruntime = 0; | 1472 | global_settings.topruntime = 0; |
1527 | break; | 1473 | break; |
1528 | } | 1474 | } |
1529 | if (!(key & BUTTON_REL)) /* ignore button releases */ | ||
1530 | break; | ||
1531 | } | 1475 | } |
1532 | break; | 1476 | break; |
1533 | } | 1477 | } |
1534 | } | 1478 | } |
1535 | 1479 | action_signalscreenchange(); | |
1536 | return false; | 1480 | return false; |
1537 | } | 1481 | } |
1538 | 1482 | ||
@@ -1620,27 +1564,26 @@ bool dbg_mmc_info(void) | |||
1620 | 1564 | ||
1621 | lcd_update(); | 1565 | lcd_update(); |
1622 | 1566 | ||
1623 | switch (button_get_w_tmo(HZ/2)) | 1567 | switch (get_action(CONTEXT_SETTINGS,HZ/2)) |
1624 | { | 1568 | { |
1625 | case SETTINGS_OK: | 1569 | case ACTION_STD_CANCEL: |
1626 | case SETTINGS_CANCEL: | ||
1627 | done = true; | 1570 | done = true; |
1628 | break; | 1571 | break; |
1629 | 1572 | ||
1630 | case SETTINGS_DEC: | 1573 | case ACTION_SETTINGS_DEC: |
1631 | currval--; | 1574 | currval--; |
1632 | if (currval < 0) | 1575 | if (currval < 0) |
1633 | currval = 3; | 1576 | currval = 3; |
1634 | break; | 1577 | break; |
1635 | 1578 | ||
1636 | case SETTINGS_INC: | 1579 | case ACTION_SETTINGS_INC: |
1637 | currval++; | 1580 | currval++; |
1638 | if (currval > 3) | 1581 | if (currval > 3) |
1639 | currval = 0; | 1582 | currval = 0; |
1640 | break; | 1583 | break; |
1641 | } | 1584 | } |
1642 | } | 1585 | } |
1643 | 1586 | action_signalscreenchange(); | |
1644 | return false; | 1587 | return false; |
1645 | } | 1588 | } |
1646 | #else /* !HAVE_MMC */ | 1589 | #else /* !HAVE_MMC */ |
@@ -1781,26 +1724,25 @@ static bool dbg_disk_info(void) | |||
1781 | lcd_update(); | 1724 | lcd_update(); |
1782 | 1725 | ||
1783 | /* Wait for a key to be pushed */ | 1726 | /* Wait for a key to be pushed */ |
1784 | key = button_get_w_tmo(HZ*5); | 1727 | key = get_action(CONTEXT_SETTINGS,HZ/5); |
1785 | switch(key) { | 1728 | switch(key) { |
1786 | case SETTINGS_OK: | 1729 | case ACTION_STD_CANCEL: |
1787 | case SETTINGS_CANCEL: | ||
1788 | done = true; | 1730 | done = true; |
1789 | break; | 1731 | break; |
1790 | 1732 | ||
1791 | case SETTINGS_DEC: | 1733 | case ACTION_SETTINGS_DEC: |
1792 | if (--page < 0) | 1734 | if (--page < 0) |
1793 | page = max_page; | 1735 | page = max_page; |
1794 | break; | 1736 | break; |
1795 | 1737 | ||
1796 | case SETTINGS_INC: | 1738 | case ACTION_SETTINGS_INC: |
1797 | if (++page > max_page) | 1739 | if (++page > max_page) |
1798 | page = 0; | 1740 | page = 0; |
1799 | break; | 1741 | break; |
1800 | } | 1742 | } |
1801 | lcd_stop_scroll(); | 1743 | lcd_stop_scroll(); |
1802 | } | 1744 | } |
1803 | 1745 | action_signalscreenchange(); | |
1804 | return false; | 1746 | return false; |
1805 | } | 1747 | } |
1806 | #endif /* !HAVE_MMC */ | 1748 | #endif /* !HAVE_MMC */ |
@@ -1849,13 +1791,8 @@ static bool dbg_dircache_info(void) | |||
1849 | 1791 | ||
1850 | lcd_update(); | 1792 | lcd_update(); |
1851 | 1793 | ||
1852 | switch (button_get_w_tmo(HZ/2)) | 1794 | if (action_userabort(HZ/2)) |
1853 | { | 1795 | return false; |
1854 | case SETTINGS_OK: | ||
1855 | case SETTINGS_CANCEL: | ||
1856 | done = true; | ||
1857 | break; | ||
1858 | } | ||
1859 | } | 1796 | } |
1860 | 1797 | ||
1861 | return false; | 1798 | return false; |
@@ -1900,13 +1837,8 @@ static bool dbg_tagcache_info(void) | |||
1900 | 1837 | ||
1901 | lcd_update(); | 1838 | lcd_update(); |
1902 | 1839 | ||
1903 | switch (button_get_w_tmo(HZ/2)) | 1840 | if (action_userabort(HZ/2)) |
1904 | { | 1841 | return false; |
1905 | case SETTINGS_OK: | ||
1906 | case SETTINGS_CANCEL: | ||
1907 | done = true; | ||
1908 | break; | ||
1909 | } | ||
1910 | } | 1842 | } |
1911 | 1843 | ||
1912 | return false; | 1844 | return false; |
@@ -1979,7 +1911,6 @@ bool dbg_save_roms(void) | |||
1979 | bool dbg_fm_radio(void) | 1911 | bool dbg_fm_radio(void) |
1980 | { | 1912 | { |
1981 | char buf[32]; | 1913 | char buf[32]; |
1982 | int button; | ||
1983 | bool fm_detected; | 1914 | bool fm_detected; |
1984 | 1915 | ||
1985 | #ifdef HAVE_LCD_BITMAP | 1916 | #ifdef HAVE_LCD_BITMAP |
@@ -2010,13 +1941,8 @@ bool dbg_fm_radio(void) | |||
2010 | 1941 | ||
2011 | lcd_update(); | 1942 | lcd_update(); |
2012 | 1943 | ||
2013 | button = button_get_w_tmo(HZ); | 1944 | if (action_userabort(TIMEOUT_BLOCK)) |
2014 | 1945 | return false; | |
2015 | switch(button) | ||
2016 | { | ||
2017 | case SETTINGS_CANCEL: | ||
2018 | return false; | ||
2019 | } | ||
2020 | } | 1946 | } |
2021 | return false; | 1947 | return false; |
2022 | } | 1948 | } |