diff options
Diffstat (limited to 'apps/plugins/clock/clock.c')
-rw-r--r-- | apps/plugins/clock/clock.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index f9da5bd09c..d0b8f90847 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c | |||
@@ -33,13 +33,14 @@ PLUGIN_HEADER | |||
33 | /* Keymaps */ | 33 | /* Keymaps */ |
34 | const struct button_mapping* plugin_contexts[]={ | 34 | const struct button_mapping* plugin_contexts[]={ |
35 | generic_actions, | 35 | generic_actions, |
36 | generic_increase_decrease, | ||
36 | generic_directions, | 37 | generic_directions, |
37 | #if NB_SCREENS == 2 | 38 | #if NB_SCREENS == 2 |
38 | remote_directions | 39 | remote_directions |
39 | #endif | 40 | #endif |
40 | }; | 41 | }; |
42 | #define PLA_ARRAY_COUNT sizeof(plugin_contexts)/sizeof(plugin_contexts[0]) | ||
41 | 43 | ||
42 | #define NB_ACTION_CONTEXTS sizeof(plugin_contexts)/sizeof(plugin_contexts[0]) | ||
43 | #define ACTION_COUNTER_TOGGLE PLA_FIRE | 44 | #define ACTION_COUNTER_TOGGLE PLA_FIRE |
44 | #define ACTION_COUNTER_RESET PLA_FIRE_REPEAT | 45 | #define ACTION_COUNTER_RESET PLA_FIRE_REPEAT |
45 | #define ACTION_MENU PLA_MENU | 46 | #define ACTION_MENU PLA_MENU |
@@ -48,10 +49,10 @@ const struct button_mapping* plugin_contexts[]={ | |||
48 | #define ACTION_MODE_NEXT_REPEAT PLA_RIGHT_REPEAT | 49 | #define ACTION_MODE_NEXT_REPEAT PLA_RIGHT_REPEAT |
49 | #define ACTION_MODE_PREV PLA_LEFT | 50 | #define ACTION_MODE_PREV PLA_LEFT |
50 | #define ACTION_MODE_PREV_REPEAT PLA_LEFT_REPEAT | 51 | #define ACTION_MODE_PREV_REPEAT PLA_LEFT_REPEAT |
51 | #define ACTION_SKIN_NEXT PLA_UP | 52 | #define ACTION_SKIN_NEXT PLA_INC |
52 | #define ACTION_SKIN_NEXT_REPEAT PLA_UP_REPEAT | 53 | #define ACTION_SKIN_NEXT_REPEAT PLA_INC_REPEAT |
53 | #define ACTION_SKIN_PREV PLA_DOWN | 54 | #define ACTION_SKIN_PREV PLA_DEC |
54 | #define ACTION_SKIN_PREV_REPEAT PLA_DOWN_REPEAT | 55 | #define ACTION_SKIN_PREV_REPEAT PLA_DEC_REPEAT |
55 | 56 | ||
56 | extern struct plugin_api* rb; | 57 | extern struct plugin_api* rb; |
57 | 58 | ||
@@ -139,7 +140,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){ | |||
139 | /************************* | 140 | /************************* |
140 | * Scan for button presses | 141 | * Scan for button presses |
141 | ************************/ | 142 | ************************/ |
142 | button = pluginlib_getaction(rb, HZ/10, plugin_contexts, NB_ACTION_CONTEXTS); | 143 | button = pluginlib_getaction(rb, HZ/10, plugin_contexts, PLA_ARRAY_COUNT); |
143 | redraw=true;/* we'll set it to false afterwards if there was no action */ | 144 | redraw=true;/* we'll set it to false afterwards if there was no action */ |
144 | switch (button){ | 145 | switch (button){ |
145 | case ACTION_COUNTER_TOGGLE: /* start/stop counter */ | 146 | case ACTION_COUNTER_TOGGLE: /* start/stop counter */ |