From 2e8e99824318aff0b032e5e060f9de8733bbcc72 Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Tue, 22 May 2018 15:22:34 +0200 Subject: touchscreen: fix touch data bulk read Signed-off-by: Dominik Sliwa --- source/adc_task.c | 4 ++-- 1 file 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; -- cgit v1.2.3