OpenHarmony开发者论坛

标题: 触摸驱动事件无法上报 [打印本页]

作者: B_MoFi    时间: 5 天前
标题: 触摸驱动事件无法上报
[md]### 【问题描述】

触摸芯片已经适配并且有触摸坐标,但是解锁或者操作屏幕都无反应,怎么解决?

[   48.030388] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:331 y = 243
[   48.048994] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.049032] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.049041] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:331 y = 243
[   48.059912] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.059937] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.059945] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:333 y = 260
[   48.078737] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.078777] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.078787] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:334 y = 284
[   48.098500] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.098562] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.098572] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:341 y = 345
[   48.118273] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.118336] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.118347] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:355 y = 416
[   48.138070] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.138114] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.138124] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:371 y = 508
[   48.157718] [E/HDF_INPUT_DRV] ParsePointData: resolutionX = 1280
[   48.157758] [E/HDF_INPUT_DRV] ParsePointData: resolutionY = 720
[   48.157767] [E/HDF_INPUT_DRV] ====ParsePointData: id: 0  x:388 y = 596

```c

static void ParsePointData(ChipDevice *device, FrameData *frame, uint8_t *buf, uint8_t pointNum)
{
    int32_t chipVer = device->chipCfg->chipVersion;
    int32_t resX = device->driver->boardCfg->attr.resolutionX;
    int32_t resY = device->driver->boardCfg->attr.resolutionY;
    int32_t i;
    uint8_t *coor_data = NULL;

    HDF_LOGE("%s: resolutionX = %d", __func__, resX);
    HDF_LOGE("%s: resolutionY = %d", __func__, resY);
    for (i = 0; i < pointNum; i++) {
        //coor_data = &buf[i * 8 + 1];
        //frame->fingers.trackId = coor_data[0]  & 0x0F;
        //frame->fingers.x = coor_data[1] | (coor_data[2] << 8);
        //frame->fingers.y = coor_data[3] | (coor_data[4] << 8);
        frame->fingers.trackId = buf[GT_POINT_SIZE * i + GT_TRACK_ID];
        frame->fingers.y = (buf[GT_POINT_SIZE * i + GT_X_LOW] & ONE_BYTE_MASK) |
                                  ((buf[GT_POINT_SIZE * i + GT_X_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET);
        frame->fingers.x = (buf[GT_POINT_SIZE * i + GT_Y_LOW] & ONE_BYTE_MASK) |
                                ((buf[GT_POINT_SIZE * i + GT_Y_HIGH] & ONE_BYTE_MASK) << ONE_BYTE_OFFSET);

        HDF_LOGE("====%s: id: %d  x:%d y = %d", __func__, frame->fingers.trackId ,frame->fingers.x , frame->fingers.y);

        if (frame->fingers.x == 0) {
            frame->fingers.x = X_OFFSET;
        }

        frame->fingers.valid = true;
    }
}
```



### 【运行环境】

硬件:rk3566
ROM版本:4.0
DevEvoStudio版本:
SDK版本:
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5