21 inch USB touch screen debugging

- Sep 23, 2019-

X Y coordinate switching


First, define

Static int X_max=0;

Static int Y_max=0;


Then in the mt_touch_input_mapping function

Case HID_UP_GENDESK:

Switch (usage->hid) {HID_GD_Y is interchanged with HID_GD_X


Case HID_GD_Y:

X_max = field->logical_maximum;

Assign a value to X_max


Case HID_GD_X:

Y_max = field->logical_maximum;

Assign a value to Y_max


Second, fix the coordinates:

Input_event(input, EV_ABS, ABS_MT_POSITION_X, s->x); -> input_event(input, EV_ABS, ABS_MT_POSITION_X, s->y);

Input_event(input, EV_ABS, ABS_MT_POSITION_Y, s->y); -> input_event(input, EV_ABS, ABS_MT_POSITION_Y, Y_max-s->x);


Finally, compile and update the system to device debugging, debug is done then