summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-10-08 11:57:55 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-10 21:33:33 -0700
commit76906482784e49e0b68148e2ac8ed33cb2d180a4 (patch)
treee2cc73c46d01c2c710ba51f584d653e85e874696
parenta8d4272aa96bee7914ce93503a3b4f0385e328a3 (diff)
downloadchrome-ec-76906482784e49e0b68148e2ac8ed33cb2d180a4.tar.gz
touchpad_st: fix bug in dump_memory
in dump_memory, rx_len includes DUMMY_BYTE, but it should not be counted when we are printing. BRANCH=nocturne BUG=b:117398324 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I9810e97b1fb0ce94973fc24963d6c6ea601759be Reviewed-on: https://chromium-review.googlesource.com/1267875 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--driver/touchpad_st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index d768502674..9e6b08f909 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -593,7 +593,7 @@ static void dump_memory(void)
spi_transaction(SPI, cmd, sizeof(cmd),
(uint8_t *)&rx_buf, rx_len);
- for (i = 0; i < rx_len; i += 32) {
+ for (i = 0; i < rx_len - ST_TP_DUMMY_BYTE; i += 32) {
CPRINTF("%.4h %.4h %.4h %.4h %.4h %.4h %.4h %.4h\n",
rx_buf.bytes + i + 4 * 0,
rx_buf.bytes + i + 4 * 1,