This commit is contained in:
刘可亮
2024-09-03 11:16:08 +08:00
parent cf270df8d6
commit 803cac77d5
2931 changed files with 614364 additions and 31222 deletions

View File

@@ -126,6 +126,9 @@ static rt_size_t rt_touch_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size
{
rt_touch_t touch;
rt_size_t result = 0;
rt_uint8_t index;
rt_uint16_t temp = 0;
struct rt_touch_data *read_data = RT_NULL;
RT_ASSERT(dev != RT_NULL);
touch = (rt_touch_t)dev;
@@ -136,6 +139,31 @@ static rt_size_t rt_touch_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size
result = touch->ops->touch_readpoint(touch, buf, len);
read_data = (struct rt_touch_data *)buf;
for (index = 0; index < len; index++) {
#ifdef AIC_TOUCH_X_FILP
read_data[index].x_coordinate = (rt_int16_t)AIC_TOUCH_X_COORDINATE_RANGE -
read_data[index].x_coordinate;
#endif
#ifdef AIC_TOUCH_Y_FILP
read_data[index].y_coordinate = (rt_int16_t)AIC_TOUCH_Y_COORDINATE_RANGE -
read_data[index].y_coordinate;
#endif
#ifdef AIC_TOUCH_90_DEGREE_ROTATION
temp = read_data[index].x_coordinate;
read_data[index].x_coordinate = (rt_int16_t)AIC_TOUCH_Y_COORDINATE_RANGE -
read_data[index].y_coordinate;
read_data[index].y_coordinate = temp;
#endif
#ifdef AIC_TOUCH_270_DEGREE_ROTATION
temp = read_data[index].x_coordinate;
read_data[index].x_coordinate = read_data[index].y_coordinate;
read_data[index].y_coordinate = (rt_int16_t)AIC_TOUCH_X_COORDINATE_RANGE - temp;
#endif
(void)read_data;
(void)temp;
}
return result;
}