summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/eve_vtrack.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve/eve_vtrack.c')
-rw-r--r--fw/fe310/eos/eve/eve_vtrack.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/fw/fe310/eos/eve/eve_vtrack.c b/fw/fe310/eos/eve/eve_vtrack.c
index bd9158b..a7619fb 100644
--- a/fw/fe310/eos/eve/eve_vtrack.c
+++ b/fw/fe310/eos/eve/eve_vtrack.c
@@ -26,9 +26,16 @@ 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_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) {
@@ -36,9 +43,10 @@ void eve_vtrack_stop(EVETouch *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) {
@@ -46,19 +54,3 @@ int eve_vtrack_acc_tick(EVETouch *touch, void *p) {
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_get_tick() - touch->t, &touch->x, &touch->y);
-}
-
-void eve_vtrack_lho_stop(EVETouch *touch, void *p) {
- eve_vtrack_reset();
-}