From 52f59f637dfcb24900b30ed52c1d7725eab93364 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sun, 18 Dec 2022 17:50:18 +0100 Subject: [PATCH] plugins: VU Meter: Ignore backlight timeout Change-Id: Ic61cbd61dab18afe951b00a84b9ebeb15a8ee5f0 --- apps/plugins/vu_meter.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 356a7fdd93..39deae6947 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -20,6 +20,8 @@ #include "plugin.h" #include "fixedpoint.h" #include "lib/playback_control.h" +#include "lib/helper.h" +#include "lib/pluginlib_exit.h" @@ -910,6 +912,12 @@ static void digital_meter(void) { rb->lcd_hline(0,LCD_WIDTH-1,half_height+3); } +static void vu_meter_cleanup(void) +{ + /* Turn on backlight timeout (revert to settings) */ + backlight_use_settings(); +} + enum plugin_status plugin_start(const void* parameter) { int button; #if defined(VUMETER_HELP_PRE) || defined(VUMETER_MENU_PRE) @@ -920,12 +928,17 @@ enum plugin_status plugin_start(const void* parameter) { calc_scales(); + atexit(vu_meter_cleanup); + load_settings(); rb->lcd_setfont(FONT_SYSFIXED); #ifdef HAVE_LCD_COLOR screen_foreground = rb->lcd_get_foreground(); #endif + /* Turn off backlight timeout */ + backlight_ignore_timeout(); + while (1) { rb->lcd_clear_display();