diff options
Diffstat (limited to 'fw/fe310/eos/eve/eve_vtrack.c')
-rw-r--r-- | fw/fe310/eos/eve/eve_vtrack.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/fw/fe310/eos/eve/eve_vtrack.c b/fw/fe310/eos/eve/eve_vtrack.c index b9f28af..a7619fb 100644 --- a/fw/fe310/eos/eve/eve_vtrack.c +++ b/fw/fe310/eos/eve/eve_vtrack.c @@ -26,40 +26,31 @@ void eve_vtrack_reset(void) { eve_vtrack_set(eve_vtrack_acc_start, eve_vtrack_acc_tick, NULL, &vtrack_acc); } -void eve_vtrack_start(EVETouch *touch, uint8_t tag0, uint32_t to) { - eve_touch_timer_set(touch, EVE_TOUCH_ETYPE_TRACK, tag0, to); - if (vtrack.start) vtrack.start(touch, vtrack.param); +int eve_vtrack_start(EVETouch *touch, uint8_t tag0, uint32_t to) { + if (vtrack.start) { + int start; + + start = vtrack.start(touch, vtrack.param); + if (start) eve_timer_set(touch, EVE_TOUCH_ETYPE_TRACK, tag0, to); + + return start; + } + return 0; } void eve_vtrack_stop(EVETouch *touch) { - eve_touch_timer_clear(touch); + eve_timer_clear(touch); eve_vtrack_reset(); } -void eve_vtrack_acc_start(EVETouch *touch, void *p) { +int eve_vtrack_acc_start(EVETouch *touch, void *p) { EVEPhyAcc *param = (EVEPhyAcc *)p; - eve_phy_acc_start(param, touch->x, touch->y, touch->vx, touch->vy); + + return eve_phy_acc_start(param, touch->x, touch->y, touch->t, touch->vx, touch->vy); } int eve_vtrack_acc_tick(EVETouch *touch, void *p) { EVEPhyAcc *param = (EVEPhyAcc *)p; - return eve_phy_acc_tick(param, eve_time_get_tick() - touch->t, &touch->x, &touch->y); + return eve_phy_acc_tick(param, eve_get_tick() - touch->t, &touch->x, &touch->y); } - -void eve_vtrack_lho_start(EVETouch *touch, void *p) { - EVEPhyLHO *param = (EVEPhyLHO *)p; - - eve_phy_lho_start(param, touch->x, touch->y); -} - -int eve_vtrack_lho_tick(EVETouch *touch, void *p) { - EVEPhyLHO *param = (EVEPhyLHO *)p; - - return eve_phy_lho_tick(param, eve_time_get_tick() - touch->t, &touch->x, &touch->y); -} - -void eve_vtrack_lho_stop(EVETouch *touch, void *p) { - eve_vtrack_reset(); -} - |