touch.c:deleting useless function (#2208)

old-commit-hash: 58e5223aba
commatwo_master
Dean Lee 5 years ago committed by GitHub
parent c613f8dfcc
commit 0392ecd4ca
  1. 28
      selfdrive/common/touch.c
  2. 6
      selfdrive/common/touch.h

@ -94,31 +94,3 @@ int touch_poll(TouchState *s, int* out_x, int* out_y, int timeout) {
} }
return up; return up;
} }
int touch_read(TouchState *s, int* out_x, int* out_y) {
assert(out_x && out_y);
struct input_event event;
int err = read(s->fd, &event, sizeof(event));
if (err < sizeof(event)) {
return -1;
}
bool up = false;
switch (event.type) {
case EV_ABS:
if (event.code == ABS_MT_POSITION_X) {
s->last_x = event.value;
} else if (event.code == ABS_MT_POSITION_Y) {
s->last_y = event.value;
}
up = true;
break;
default:
break;
}
if (up) {
// adjust for flippening
*out_x = s->last_y;
*out_y = 1080 - s->last_x;
}
return up;
}

@ -1,5 +1,4 @@
#ifndef TOUCH_H #pragma once
#define TOUCH_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -12,10 +11,7 @@ typedef struct TouchState {
void touch_init(TouchState *s); void touch_init(TouchState *s);
int touch_poll(TouchState *s, int *out_x, int *out_y, int timeout); int touch_poll(TouchState *s, int *out_x, int *out_y, int timeout);
int touch_read(TouchState *s, int* out_x, int* out_y);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif

Loading…
Cancel
Save