diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-30 01:23:39 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-11-21 20:26:20 +0000 |
commit | bff63a4f909770d86b12217e9003a22c54789c7b (patch) | |
tree | ce426feda1037c6dc3246fea9ad39230b3d73d50 /firmware | |
parent | 7e428ad190dd8d928fbb1451a7bb81dd4e856258 (diff) | |
download | rockbox-bff63a4f909770d86b12217e9003a22c54789c7b.tar.gz rockbox-bff63a4f909770d86b12217e9003a22c54789c7b.zip |
touchscreen: change odd sentinel value for time of last touch
Using tick 0xffff does not make any sense, use -1 instead.
Change-Id: Id574eb35418c6713c4fc91ed539aadc42fd29aa5
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/button.c | 6 | ||||
-rw-r--r-- | firmware/export/button.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 0af51dc3b2..9979bc0155 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -94,7 +94,7 @@ static int button_read(void); | |||
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #ifdef HAVE_TOUCHSCREEN | 96 | #ifdef HAVE_TOUCHSCREEN |
97 | static int last_touchscreen_touch; | 97 | static long last_touchscreen_touch; |
98 | #endif | 98 | #endif |
99 | #if defined(HAVE_HEADPHONE_DETECTION) | 99 | #if defined(HAVE_HEADPHONE_DETECTION) |
100 | static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ | 100 | static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */ |
@@ -542,7 +542,7 @@ void button_init(void) | |||
542 | #endif | 542 | #endif |
543 | #endif | 543 | #endif |
544 | #ifdef HAVE_TOUCHSCREEN | 544 | #ifdef HAVE_TOUCHSCREEN |
545 | last_touchscreen_touch = 0xffff; | 545 | last_touchscreen_touch = -1; |
546 | #endif | 546 | #endif |
547 | /* Start polling last */ | 547 | /* Start polling last */ |
548 | tick_add_task(button_tick); | 548 | tick_add_task(button_tick); |
@@ -714,7 +714,7 @@ void button_clear_queue(void) | |||
714 | } | 714 | } |
715 | 715 | ||
716 | #ifdef HAVE_TOUCHSCREEN | 716 | #ifdef HAVE_TOUCHSCREEN |
717 | int touchscreen_last_touch(void) | 717 | long touchscreen_last_touch(void) |
718 | { | 718 | { |
719 | return last_touchscreen_touch; | 719 | return last_touchscreen_touch; |
720 | } | 720 | } |
diff --git a/firmware/export/button.h b/firmware/export/button.h index 1745947230..3abad2d4f0 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -107,7 +107,7 @@ int button_apply_acceleration(const unsigned int data); | |||
107 | BUTTON_MULTIMEDIA_FFWD) | 107 | BUTTON_MULTIMEDIA_FFWD) |
108 | 108 | ||
109 | #ifdef HAVE_TOUCHSCREEN | 109 | #ifdef HAVE_TOUCHSCREEN |
110 | int touchscreen_last_touch(void); | 110 | long touchscreen_last_touch(void); |
111 | 111 | ||
112 | #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ | 112 | #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ |
113 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ | 113 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ |