diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 7199d99e28..806ae6dcfa 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -87,7 +87,7 @@ static int button_read(void); #ifdef HAVE_TOUCHSCREEN static int last_touchscreen_touch; #endif -#if defined(HAVE_HEADPHONE_DETECTION) && !defined(SIMULATOR) +#if defined(HAVE_HEADPHONE_DETECTION) static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ /* This callback can be used for many different functions if needed - just check to which object tmo points */ diff --git a/uisimulator/sdl/button-sdl.h b/uisimulator/sdl/button-sdl.h index 0adb434e6a..5a0a7e2620 100644 --- a/uisimulator/sdl/button-sdl.h +++ b/uisimulator/sdl/button-sdl.h @@ -27,7 +27,6 @@ #include "config.h" #include "button-target.h" -#define HAS_BUTTON_HOLD #undef HAVE_LCD_FLIP #undef button_init_device diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index c52cf12f9c..5bda8a3ffd 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -1216,17 +1216,23 @@ int button_read_device(int* data) int button_read_device(void) { #endif - static int hold_button_old = false; + +#ifdef HAS_BUTTON_HOLD int hold_button = button_hold(); + +#ifdef HAVE_BACKLIGHT /* light handling */ + static int hold_button_old = false; if (hold_button != hold_button_old) { hold_button_old = hold_button; backlight_hold_changed(hold_button); } +#endif if (hold_button) return BUTTON_NONE; +#endif return btn; }