summaryrefslogtreecommitdiff
path: root/apps/plugins/alarmclock.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/alarmclock.c')
-rw-r--r--apps/plugins/alarmclock.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/plugins/alarmclock.c b/apps/plugins/alarmclock.c
index 88e3e858cb..23ad886f6c 100644
--- a/apps/plugins/alarmclock.c
+++ b/apps/plugins/alarmclock.c
@@ -24,8 +24,7 @@
24 24
25PLUGIN_HEADER 25PLUGIN_HEADER
26 26
27const struct button_mapping *plugin_contexts[] = {generic_directions, 27const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
28 generic_actions};
29 28
30static int current = 0; 29static int current = 0;
31static bool tomorrow = false; 30static bool tomorrow = false;
@@ -33,7 +32,8 @@ static int alarm[2] = {0, 0}, maxval[2] = {24, 60}, prev_tick = 3600 * 24;
33static bool quit = false, usb = false, waiting = false, done = false; 32static bool quit = false, usb = false, waiting = false, done = false;
34 33
35static inline int get_button(void) { 34static inline int get_button(void) {
36 return pluginlib_getaction(HZ/2, plugin_contexts, 2); 35 return pluginlib_getaction(HZ/2, plugin_contexts,
36 ARRAYLEN(plugin_contexts));
37} 37}
38 38
39int rem_seconds(void) { 39int rem_seconds(void) {
@@ -125,7 +125,7 @@ enum plugin_status plugin_start(const void* parameter)
125 while(!quit) { 125 while(!quit) {
126 button = get_button(); 126 button = get_button();
127 127
128 if (button == PLA_QUIT) 128 if (button == PLA_EXIT || PLA_CANCEL)
129 quit = true; 129 quit = true;
130 130
131 FOR_NB_SCREENS(i) { 131 FOR_NB_SCREENS(i) {
@@ -157,7 +157,8 @@ enum plugin_status plugin_start(const void* parameter)
157 current = (current + 1) % 2; 157 current = (current + 1) % 2;
158 break; 158 break;
159 159
160 case PLA_FIRE: { 160 case PLA_SELECT:
161 case PLA_SELECT_REPEAT: {
161 if (rem_seconds() < 0) 162 if (rem_seconds() < 0)
162 tomorrow = true; 163 tomorrow = true;
163 164