diff options
Diffstat (limited to 'apps/plugins/test_fps.c')
-rw-r--r-- | apps/plugins/test_fps.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index d5bfb55907..358ab827f3 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -23,31 +23,14 @@ | |||
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/pluginlib_touchscreen.h" | 24 | #include "lib/pluginlib_touchscreen.h" |
25 | #include "lib/pluginlib_exit.h" | 25 | #include "lib/pluginlib_exit.h" |
26 | #include "lib/pluginlib_actions.h" | ||
26 | 27 | ||
27 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 28 | /* this set the context to use with PLA */ |
28 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 29 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
29 | #define FPS_QUIT BUTTON_MENU | 30 | |
30 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 31 | |
31 | #define FPS_QUIT BUTTON_RC_REC | 32 | #define FPS_QUIT PLA_EXIT |
32 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | 33 | #define FPS_QUIT2 PLA_CANCEL |
33 | #define FPS_QUIT BUTTON_PLAY | ||
34 | #elif CONFIG_KEYPAD == SANSA_FUZE_PAD | ||
35 | #define FPS_QUIT (BUTTON_HOME|BUTTON_REPEAT) | ||
36 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
37 | #define FPS_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
38 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
39 | #define FPS_QUIT (BUTTON_REC|BUTTON_REPEAT) | ||
40 | #elif CONFIG_KEYPAD == RK27XX_GENERIC_PAD | ||
41 | #define FPS_QUIT (BUTTON_M|BUTTON_REPEAT) | ||
42 | #elif CONFIG_KEYPAD == SAMSUNG_YPR0_PAD | ||
43 | #define FPS_QUIT BUTTON_BACK | ||
44 | #elif defined(HAVE_TOUCHSCREEN) | ||
45 | #define FPS_QUIT (BUTTON_BOTTOMMIDDLE|BUTTON_REL) | ||
46 | #elif defined(BUTTON_OFF) | ||
47 | #define FPS_QUIT BUTTON_OFF | ||
48 | #else | ||
49 | #define FPS_QUIT BUTTON_POWER | ||
50 | #endif | ||
51 | 34 | ||
52 | #define DURATION (2*HZ) /* longer duration gives more precise results */ | 35 | #define DURATION (2*HZ) /* longer duration gives more precise results */ |
53 | 36 | ||
@@ -391,9 +374,10 @@ void plugin_quit(void) | |||
391 | #endif | 374 | #endif |
392 | while (1) | 375 | while (1) |
393 | { | 376 | { |
394 | int btn = rb->button_get(true); | 377 | int btn = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, |
378 | ARRAYLEN(plugin_contexts)); | ||
395 | exit_on_usb(btn); | 379 | exit_on_usb(btn); |
396 | if (btn == FPS_QUIT) | 380 | if ((btn == FPS_QUIT) || (btn == FPS_QUIT2)) |
397 | break; | 381 | break; |
398 | } | 382 | } |
399 | } | 383 | } |