diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 088ba0a4c5..71cd4726cc 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -385,11 +385,7 @@ long button_get_w_tmo(int ticks) intptr_t button_get_data(void) { -#if defined(SIMULATOR) - return button_get_data_sdl(); -#else return button_data; -#endif } void button_init(void) diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 5bda8a3ffd..ee0a24008b 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -1211,7 +1211,13 @@ void button_event(int key, bool pressed) #ifdef HAVE_BUTTON_DATA int button_read_device(int* data) { - (void)data; +#if defined(HAVE_TOUCHSCREEN) + *data=mouse_coords; +#else + /* pass scrollwheel acceleration to the button driver */ + *data = 1<<24; +#endif + #else int button_read_device(void) { @@ -1264,20 +1270,8 @@ void mouse_tick_task(void) printf("Mouse at: (%d, %d)\n", x, y); } } - #endif -intptr_t button_get_data_sdl(void) -{ -#ifdef HAVE_TOUCHSCREEN - /* pass the mouse coordinates to the button driver */ - return mouse_coords; -#else - /* pass scrollwheel acceleration to the button driver */ - return 1<<24; -#endif -} - void button_init_sdl(void) { #ifdef HAVE_TOUCHSCREEN