diff options
Diffstat (limited to 'apps/plugins/lamp.c')
-rw-r--r-- | apps/plugins/lamp.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/plugins/lamp.c b/apps/plugins/lamp.c index fa7027ece7..6c9ae6626d 100644 --- a/apps/plugins/lamp.c +++ b/apps/plugins/lamp.c | |||
@@ -45,6 +45,7 @@ static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; | |||
45 | # define LAMP_DOWN PLA_SCROLL_BACK | 45 | # define LAMP_DOWN PLA_SCROLL_BACK |
46 | # define LAMP_UP_REPEAT PLA_SCROLL_FWD_REPEAT | 46 | # define LAMP_UP_REPEAT PLA_SCROLL_FWD_REPEAT |
47 | # define LAMP_DOWN_REPEAT PLA_SCROLL_BACK_REPEAT | 47 | # define LAMP_DOWN_REPEAT PLA_SCROLL_BACK_REPEAT |
48 | # define LAMP_TOGGLE_BUTTON PLA_SELECT | ||
48 | #else | 49 | #else |
49 | # define LAMP_LEFT PLA_LEFT | 50 | # define LAMP_LEFT PLA_LEFT |
50 | # define LAMP_RIGHT PLA_RIGHT | 51 | # define LAMP_RIGHT PLA_RIGHT |
@@ -52,6 +53,7 @@ static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; | |||
52 | # define LAMP_DOWN PLA_DOWN | 53 | # define LAMP_DOWN PLA_DOWN |
53 | # define LAMP_UP_REPEAT PLA_UP_REPEAT | 54 | # define LAMP_UP_REPEAT PLA_UP_REPEAT |
54 | # define LAMP_DOWN_REPEAT PLA_DOWN_REPEAT | 55 | # define LAMP_DOWN_REPEAT PLA_DOWN_REPEAT |
56 | # define LAMP_TOGGLE_BUTTON PLA_SELECT | ||
55 | #endif/* HAVE_SCROLLWHEEL */ | 57 | #endif/* HAVE_SCROLLWHEEL */ |
56 | 58 | ||
57 | 59 | ||
@@ -87,6 +89,9 @@ enum plugin_status plugin_start(const void* parameter) | |||
87 | int cs = 0; | 89 | int cs = 0; |
88 | bool update = false; | 90 | bool update = false; |
89 | #endif /* HAVE_LCD_COLOR */ | 91 | #endif /* HAVE_LCD_COLOR */ |
92 | #ifdef HAVE_BUTTON_LIGHT | ||
93 | bool buttonlight_on = true; | ||
94 | #endif /* HAVE_BUTTON_LIGHT */ | ||
90 | 95 | ||
91 | #if LCD_DEPTH > 1 | 96 | #if LCD_DEPTH > 1 |
92 | unsigned bg_color = rb->lcd_get_background(); | 97 | unsigned bg_color = rb->lcd_get_background(); |
@@ -169,6 +174,20 @@ enum plugin_status plugin_start(const void* parameter) | |||
169 | backlight_brightness_set(--current_brightness); | 174 | backlight_brightness_set(--current_brightness); |
170 | break; | 175 | break; |
171 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ | 176 | #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ |
177 | #ifdef HAVE_BUTTON_LIGHT | ||
178 | case LAMP_TOGGLE_BUTTON: | ||
179 | if(buttonlight_on) | ||
180 | { | ||
181 | buttonlight_force_off(); | ||
182 | buttonlight_on = false; | ||
183 | } | ||
184 | else | ||
185 | { | ||
186 | buttonlight_force_on(); | ||
187 | buttonlight_on = true; | ||
188 | } | ||
189 | break; | ||
190 | #endif /* HAVE_BUTTON_LIGHT */ | ||
172 | case LAMP_EXIT: | 191 | case LAMP_EXIT: |
173 | case LAMP_EXIT2: | 192 | case LAMP_EXIT2: |
174 | quit = true; | 193 | quit = true; |