From ff9aa508549458ada0b46b12e269e0508a42c93d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 28 Dec 2023 18:42:22 +0200 Subject: [PATCH] Fix >=96 power_led_dim values affecting led sound filter state --- cia.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cia.cpp b/cia.cpp index 13860fe9..9ea46f52 100644 --- a/cia.cpp +++ b/cia.cpp @@ -1252,6 +1252,7 @@ static void calc_led(int old_led) static void led_vsync(void) { int v; + bool ledonoff; calc_led(led); if (led_cycles_on && !led_cycles_off) @@ -1264,6 +1265,7 @@ static void led_vsync(void) v = 255; if (v < 0) v = 0; + ledonoff = v > 96; if (currprefs.power_led_dim && v < currprefs.power_led_dim) v = currprefs.power_led_dim; if (v > 255) @@ -1271,8 +1273,8 @@ static void led_vsync(void) gui_data.powerled_brightness = v; led_cycles_on = 0; led_cycles_off = 0; - if (led_old_brightness != gui_data.powerled_brightness) { - gui_data.powerled = gui_data.powerled_brightness > 96; + if (led_old_brightness != gui_data.powerled_brightness || ledonoff != gui_data.powerled) { + gui_data.powerled = ledonoff; gui_led (LED_POWER, gui_data.powerled, gui_data.powerled_brightness); led_filter_audio(); } -- 2.47.3