diff options
-rw-r--r-- | firmware/drivers/button.c | 2 | ||||
-rw-r--r-- | uisimulator/sdl/button-sdl.h | 1 | ||||
-rw-r--r-- | uisimulator/sdl/button.c | 8 |
3 files changed, 8 insertions, 3 deletions
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); | |||
87 | #ifdef HAVE_TOUCHSCREEN | 87 | #ifdef HAVE_TOUCHSCREEN |
88 | static int last_touchscreen_touch; | 88 | static int last_touchscreen_touch; |
89 | #endif | 89 | #endif |
90 | #if defined(HAVE_HEADPHONE_DETECTION) && !defined(SIMULATOR) | 90 | #if defined(HAVE_HEADPHONE_DETECTION) |
91 | static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ | 91 | static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ |
92 | /* This callback can be used for many different functions if needed - | 92 | /* This callback can be used for many different functions if needed - |
93 | just check to which object tmo points */ | 93 | 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 @@ | |||
27 | #include "config.h" | 27 | #include "config.h" |
28 | #include "button-target.h" | 28 | #include "button-target.h" |
29 | 29 | ||
30 | #define HAS_BUTTON_HOLD | ||
31 | #undef HAVE_LCD_FLIP | 30 | #undef HAVE_LCD_FLIP |
32 | 31 | ||
33 | #undef button_init_device | 32 | #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) | |||
1216 | int button_read_device(void) | 1216 | int button_read_device(void) |
1217 | { | 1217 | { |
1218 | #endif | 1218 | #endif |
1219 | static int hold_button_old = false; | 1219 | |
1220 | #ifdef HAS_BUTTON_HOLD | ||
1220 | int hold_button = button_hold(); | 1221 | int hold_button = button_hold(); |
1222 | |||
1223 | #ifdef HAVE_BACKLIGHT | ||
1221 | /* light handling */ | 1224 | /* light handling */ |
1225 | static int hold_button_old = false; | ||
1222 | if (hold_button != hold_button_old) | 1226 | if (hold_button != hold_button_old) |
1223 | { | 1227 | { |
1224 | hold_button_old = hold_button; | 1228 | hold_button_old = hold_button; |
1225 | backlight_hold_changed(hold_button); | 1229 | backlight_hold_changed(hold_button); |
1226 | } | 1230 | } |
1231 | #endif | ||
1227 | 1232 | ||
1228 | if (hold_button) | 1233 | if (hold_button) |
1229 | return BUTTON_NONE; | 1234 | return BUTTON_NONE; |
1235 | #endif | ||
1230 | 1236 | ||
1231 | return btn; | 1237 | return btn; |
1232 | } | 1238 | } |