mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
touchscreen: change odd sentinel value for time of last touch
Using tick 0xffff does not make any sense, use -1 instead. Change-Id: Id574eb35418c6713c4fc91ed539aadc42fd29aa5
This commit is contained in:
parent
7e428ad190
commit
bff63a4f90
4 changed files with 8 additions and 8 deletions
|
@ -1187,7 +1187,7 @@ static int parse_progressbar_tag(struct skin_element* element,
|
||||||
region->reverse_bar = false;
|
region->reverse_bar = false;
|
||||||
region->allow_while_locked = false;
|
region->allow_while_locked = false;
|
||||||
region->press_length = PRESS;
|
region->press_length = PRESS;
|
||||||
region->last_press = 0xffff;
|
region->last_press = -1;
|
||||||
region->armed = false;
|
region->armed = false;
|
||||||
region->bar = PTRTOSKINOFFSET(skin_buffer, pb);
|
region->bar = PTRTOSKINOFFSET(skin_buffer, pb);
|
||||||
|
|
||||||
|
@ -1602,7 +1602,7 @@ static int parse_touchregion(struct skin_element *element,
|
||||||
region->armed = false;
|
region->armed = false;
|
||||||
region->reverse_bar = false;
|
region->reverse_bar = false;
|
||||||
region->value = 0;
|
region->value = 0;
|
||||||
region->last_press = 0xffff;
|
region->last_press = -1;
|
||||||
region->press_length = PRESS;
|
region->press_length = PRESS;
|
||||||
region->allow_while_locked = false;
|
region->allow_while_locked = false;
|
||||||
region->bar = PTRTOSKINOFFSET(skin_buffer, NULL);
|
region->bar = PTRTOSKINOFFSET(skin_buffer, NULL);
|
||||||
|
|
|
@ -1367,7 +1367,7 @@ const char *get_token_value(struct gui_wps *gwps,
|
||||||
case SKIN_TOKEN_LASTTOUCH:
|
case SKIN_TOKEN_LASTTOUCH:
|
||||||
{
|
{
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
unsigned int last_touch = touchscreen_last_touch();
|
long last_touch = touchscreen_last_touch();
|
||||||
char *skin_base = get_skin_buffer(data);
|
char *skin_base = get_skin_buffer(data);
|
||||||
struct touchregion_lastpress *data = SKINOFFSETTOPTR(skin_base, token->value.data);
|
struct touchregion_lastpress *data = SKINOFFSETTOPTR(skin_base, token->value.data);
|
||||||
if (!data) return NULL;
|
if (!data) return NULL;
|
||||||
|
@ -1375,7 +1375,7 @@ const char *get_token_value(struct gui_wps *gwps,
|
||||||
if (region)
|
if (region)
|
||||||
last_touch = region->last_press;
|
last_touch = region->last_press;
|
||||||
|
|
||||||
if (last_touch != 0xffff &&
|
if (last_touch != -1 &&
|
||||||
TIME_BEFORE(current_tick, data->timeout + last_touch))
|
TIME_BEFORE(current_tick, data->timeout + last_touch))
|
||||||
return "t";
|
return "t";
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -94,7 +94,7 @@ static int button_read(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
static int last_touchscreen_touch;
|
static long last_touchscreen_touch;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_HEADPHONE_DETECTION)
|
#if defined(HAVE_HEADPHONE_DETECTION)
|
||||||
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
||||||
|
@ -542,7 +542,7 @@ void button_init(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
last_touchscreen_touch = 0xffff;
|
last_touchscreen_touch = -1;
|
||||||
#endif
|
#endif
|
||||||
/* Start polling last */
|
/* Start polling last */
|
||||||
tick_add_task(button_tick);
|
tick_add_task(button_tick);
|
||||||
|
@ -714,7 +714,7 @@ void button_clear_queue(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
int touchscreen_last_touch(void)
|
long touchscreen_last_touch(void)
|
||||||
{
|
{
|
||||||
return last_touchscreen_touch;
|
return last_touchscreen_touch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ int button_apply_acceleration(const unsigned int data);
|
||||||
BUTTON_MULTIMEDIA_FFWD)
|
BUTTON_MULTIMEDIA_FFWD)
|
||||||
|
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
int touchscreen_last_touch(void);
|
long touchscreen_last_touch(void);
|
||||||
|
|
||||||
#if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
|
#if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \
|
||||||
|| !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
|
|| !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue