diff options
Diffstat (limited to 'apps/plugins/lib')
| -rw-r--r-- | apps/plugins/lib/helper.c | 19 | ||||
| -rw-r--r-- | apps/plugins/lib/helper.h | 5 |
2 files changed, 23 insertions, 1 deletions
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c index 3af60b5..8ac822b 100644 --- a/apps/plugins/lib/helper.c +++ b/apps/plugins/lib/helper.c @@ -72,3 +72,22 @@ void remote_backlight_use_settings(struct plugin_api* rb) #endif /* CONFIG_CHARGING */ } #endif /* HAVE_REMOTE_LCD */ + +#ifdef HAVE_BUTTON_LIGHT +/* Force the buttonlight on */ +void buttonlight_force_on(struct plugin_api* rb) +{ + if (!rb) + return; + if (rb->global_settings->buttonlight_timeout > 0) + rb->buttonlight_set_timeout(0); +} + +/* Reset buttonlight operation to its settings */ +void buttonlight_use_settings(struct plugin_api* rb) +{ + if (!rb) + return; + rb->buttonlight_set_timeout(rb->global_settings->buttonlight_timeout); +} +#endif /* HAVE_BUTTON_LIGHT */ diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h index 744ad4d..4d1328b 100644 --- a/apps/plugins/lib/helper.h +++ b/apps/plugins/lib/helper.h @@ -30,5 +30,8 @@ void backlight_use_settings(struct plugin_api* rb); void remote_backlight_force_on(struct plugin_api* rb); void remote_backlight_use_settings(struct plugin_api* rb); #endif - +#ifdef HAVE_BUTTON_LIGHT +void buttonlight_force_on(struct plugin_api* rb); +void buttonlight_use_settings(struct plugin_api* rb); +#endif #endif |