bdk: touch: refactor

And also use packet mode for big tx/rx combo i2c trasnfers.
This commit is contained in:
CTCaer authored and NaGa committed 2026-03-27 20:08:45 +01:00
1 parent 476c070cf4
commit 2a7e148011
3 files changed
+191 -182

No files matched your search

+7 -7
View File
@@ -1,7 +1,7 @@
/*
* USB Gadget HID driver for Tegra X1
*
* Copyright (c) 2019-2025 CTCaer
* Copyright (c) 2019-2026 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -315,7 +315,7 @@ typedef struct _touchpad_report_t
static bool _fts_touch_read(touchpad_report_t *rpt)
{
static touch_event touchpad;
static touch_event_t touchpad;
touch_poll(&touchpad);
@@ -323,24 +323,24 @@ static bool _fts_touch_read(touchpad_report_t *rpt)
rpt->count = 1;
// Decide touch enable.
switch (touchpad.type & STMFTS_MASK_EVENT_ID)
switch (touchpad.type & FTS4_MASK_EVENT_ID)
{
//case STMFTS_EV_MULTI_TOUCH_ENTER:
case STMFTS_EV_MULTI_TOUCH_MOTION:
//case FTS4_EV_MULTI_TOUCH_ENTER:
case FTS4_EV_MULTI_TOUCH_MOTION:
rpt->x = touchpad.x;
rpt->y = touchpad.y;
//rpt->z = touchpad.z;
rpt->id = touchpad.fingers ? touchpad.fingers - 1 : 0;
rpt->tip_switch = 1;
break;
case STMFTS_EV_MULTI_TOUCH_LEAVE:
case FTS4_EV_MULTI_TOUCH_LEAVE:
rpt->x = touchpad.x;
rpt->y = touchpad.y;
//rpt->z = touchpad.z;
rpt->id = touchpad.fingers ? touchpad.fingers - 1 : 0;
rpt->tip_switch = 0;
break;
case STMFTS_EV_NO_EVENT:
case FTS4_EV_NO_EVENT:
return false;
}