diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2018-05-22 15:22:34 +0200 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2018-05-22 15:22:34 +0200 |
commit | 2e8e99824318aff0b032e5e060f9de8733bbcc72 (patch) | |
tree | 4d266e6028b33eee6883a90928d9ac0e3f7c64a7 | |
parent | 0820a1d4a6eaf47e414c5077cc8c64d1295ebf3a (diff) |
touchscreen: fix touch data bulk read
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
-rw-r--r-- | source/adc_task.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/adc_task.c b/source/adc_task.c index 56a46c1..94cf89e 100644 --- a/source/adc_task.c +++ b/source/adc_task.c @@ -232,11 +232,11 @@ int tsc_registers(dspi_transfer_t *spi_transfer) } } else if (rx_buf[0] == APALIS_TK1_K20_BULK_READ_INST) { if (rx_buf[1] == APALIS_TK1_K20_TSC_XML) { - if (rx_buf[1] == 2) { + if (rx_buf[2] == 2) { tx_buf[0] = adc_data.tsc_xm & 0xFF; tx_buf[1] = (adc_data.tsc_xm >> 8) & 0xFF; return 2; - } else if (rx_buf[1] == 8) { + } else if (rx_buf[2] == 8) { tx_buf[0] = adc_data.tsc_xm & 0xFF; tx_buf[1] = (adc_data.tsc_xm >> 8) & 0xFF; tx_buf[2] = adc_data.tsc_xp & 0xFF; |