diff options
Diffstat (limited to 'fw/fe310/eos/eve/eve_touch.c')
-rw-r--r-- | fw/fe310/eos/eve/eve_touch.c | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/fw/fe310/eos/eve/eve_touch.c b/fw/fe310/eos/eve/eve_touch.c index d17a509..a729346 100644 --- a/fw/fe310/eos/eve/eve_touch.c +++ b/fw/fe310/eos/eve/eve_touch.c @@ -54,7 +54,6 @@ void eve_handle_touch(uint16_t intr_flags) { if (timer_evt) { uint16_t _touch_evt = 0; - touch->eevt &= ~EVE_TOUCH_EETYPE_NOTOUCH; if (timer_evt & EVE_TOUCH_ETYPE_TAP2) { int dx = touch_x - touch->x0; int dy = touch_y - touch->y0; @@ -80,10 +79,10 @@ void eve_handle_touch(uint16_t intr_flags) { _touch_evt |= EVE_TOUCH_ETYPE_TIMER_ABORT; } - eve_timer_clear(touch); if (touch_handler && _touch_evt) { touch_handler(touch_timer.touch, _touch_evt, touch_timer.tag0, touch_handler_param); } + eve_timer_clear(touch); } touch_evt |= EVE_TOUCH_ETYPE_POINT | _evt; touch->eevt = _eevt; @@ -164,31 +163,29 @@ void eve_handle_touch(uint16_t intr_flags) { touch_evt &= ~EVE_TOUCH_ETYPE_TRACK_REG; } } - } else { - if (!(touch->eevt & EVE_TOUCH_EETYPE_NOTOUCH)) { - touch_evt |= EVE_TOUCH_ETYPE_POINT_UP; - touch->eevt |= EVE_TOUCH_EETYPE_NOTOUCH; + } else if (!(touch->eevt & EVE_TOUCH_EETYPE_NOTOUCH)) { + touch_evt |= EVE_TOUCH_ETYPE_POINT_UP; + touch->eevt |= EVE_TOUCH_EETYPE_NOTOUCH; - timer_evt = eve_timer_get_evt(touch); - if (timer_evt & EVE_TOUCH_ETYPE_LPRESS) { - eve_timer_set_evt(touch, timer_evt & ~EVE_TOUCH_ETYPE_LPRESS); - } - if (touch->tracker.tag && touch->tracker.track) { - int start = 0; - uint8_t opt = touch_tag_opt[touch->tracker.tag]; - uint8_t track_ext = ((opt & EVE_TOUCH_OPT_TRACK_EXT_X) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_X)) || - ((opt & EVE_TOUCH_OPT_TRACK_EXT_Y) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_Y)); + timer_evt = eve_timer_get_evt(touch); + if (timer_evt & EVE_TOUCH_ETYPE_LPRESS) { + eve_timer_set_evt(touch, timer_evt & ~EVE_TOUCH_ETYPE_LPRESS); + } + if (touch->tracker.tag && touch->tracker.track) { + int start = 0; + uint8_t opt = touch_tag_opt[touch->tracker.tag]; + uint8_t track_ext = ((opt & EVE_TOUCH_OPT_TRACK_EXT_X) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_X)) || + ((opt & EVE_TOUCH_OPT_TRACK_EXT_Y) && (touch->eevt & EVE_TOUCH_EETYPE_TRACK_Y)); - if (!eve_timer_get_evt(NULL) && track_ext) { - EVEVTrack *vtrack = eve_vtrack_get(); + if (!eve_timer_get_evt(NULL) && track_ext) { + EVEVTrack *vtrack = eve_vtrack_get(); - if (vtrack->start) start = vtrack->start(touch, vtrack->param); - } - if (start) { - eve_timer_set(touch, EVE_TOUCH_ETYPE_TRACK, touch_tag0, EVE_TOUCH_TIMEOUT_TRACK); - } else { - touch_evt |= EVE_TOUCH_ETYPE_TRACK_STOP; - } + if (vtrack->start) start = vtrack->start(touch, vtrack->param); + } + if (start) { + eve_timer_set(touch, EVE_TOUCH_ETYPE_TRACK, touch_tag0, EVE_TOUCH_TIMEOUT_TRACK); + } else { + touch_evt |= EVE_TOUCH_ETYPE_TRACK_STOP; } } } |