diff --git a/selfdrive/common/touch.c b/selfdrive/common/touch.c index 2225ed215c..0ab1e38c00 100644 --- a/selfdrive/common/touch.c +++ b/selfdrive/common/touch.c @@ -94,31 +94,3 @@ int touch_poll(TouchState *s, int* out_x, int* out_y, int timeout) { } 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; -} diff --git a/selfdrive/common/touch.h b/selfdrive/common/touch.h index c48f66b982..fa0faa271b 100644 --- a/selfdrive/common/touch.h +++ b/selfdrive/common/touch.h @@ -1,5 +1,4 @@ -#ifndef TOUCH_H -#define TOUCH_H +#pragma once #ifdef __cplusplus extern "C" { @@ -12,10 +11,7 @@ typedef struct TouchState { void touch_init(TouchState *s); 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 } #endif - -#endif