diff options
author | Tai Kuo <taikuo@google.com> | 2020-10-28 20:07:15 +0800 |
---|---|---|
committer | Tai Kuo <taikuo@google.com> | 2020-10-29 13:59:31 +0800 |
commit | a49f1eca5b0001de64c272a940b54d49b1dd2635 (patch) | |
tree | 080bca58b6b8ddf6d8f2ddd2bd3eda7d44ce610d | |
parent | 5b34d87763a7fc5e27b48ec08f22856257fc1442 (diff) | |
download | fts_touch-a49f1eca5b0001de64c272a940b54d49b1dd2635.tar.gz |
touch: fts: show ito_max_val at stdout only for ITO commands
Fix bugs from commit a024da8a94e748425c315e86f966dedaa317bd84:
1. Fix CMD_GETMSFRAME, CMD_TP_SENS_STD driver_test stdout overflow.
2. Remove the first line redundant zeros of MS raw and strength
stm_fts_cmd stdout.
Bug: 171869006
Test: Test CMD_GETMSFRAME, CMD_TP_SENS_STD and CMD_ITOTEST of driver_test.
Test: Test MS raw, MS strength and ITO commands of stm_fts_cmd.
Signed-off-by: Tai Kuo <taikuo@google.com>
Change-Id: I4e9195c6bffd930eef52490bacd9fc76b792ecd5
-rw-r--r-- | fts.c | 37 | ||||
-rw-r--r-- | fts_proc.c | 27 |
2 files changed, 36 insertions, 28 deletions
@@ -2262,12 +2262,14 @@ END: index += scnprintf(all_strbuff + index, size - index, "%3d", (u8)frameMS.header.sense_node); - index += scnprintf(all_strbuff + index, - size - index, " %d ", - ito_max_val[0]); - index += scnprintf(all_strbuff + index, - size - index, "%d ", - ito_max_val[1]); + if (typeOfCommand[0] == 0x01) { + index += scnprintf(all_strbuff + index, + size - index, " %d ", + ito_max_val[0]); + index += scnprintf(all_strbuff + index, + size - index, "%d ", + ito_max_val[1]); + } #else index += scnprintf(all_strbuff + index, size - index, "%02X", @@ -2276,18 +2278,19 @@ END: index += scnprintf(all_strbuff + index, size - index, "%02X", (u8)frameMS.header.sense_node); + if (typeOfCommand[0] == 0x01) { + index += scnprintf(all_strbuff + index, + size - index, + "%02X%02X", + (ito_max_val[0] & 0xFF00) >> 8, + ito_max_val[0] & 0xFF); - index += scnprintf(all_strbuff + index, - size - index, - "%02X%02X", - (ito_max_val[0] & 0xFF00) >> 8, - ito_max_val[0] & 0xFF); - - index += scnprintf(all_strbuff + index, - size - index, - "%02X%02X", - (ito_max_val[1] & 0xFF00) >> 8, - ito_max_val[1] & 0xFF); + index += scnprintf(all_strbuff + index, + size - index, + "%02X%02X", + (ito_max_val[1] & 0xFF00) >> 8, + ito_max_val[1] & 0xFF); + } #endif for (j = 0; j < frameMS.node_data_size; j++) { @@ -2928,6 +2928,9 @@ END: /* here start the reporting phase, assembling the data to send in the } if (byte_call == 0) { + /* keep for ito_max_val array */ + if (funcToTest[0] == CMD_ITOTEST) + size += (ARRAY_SIZE(ito_max_val) * sizeof(u16)); size *= 2; size += 2; /* add \n and \0 (terminator char) */ } else { @@ -3020,17 +3023,19 @@ END: /* here start the reporting phase, assembling the data to send in the size - index, "%02X", (u8)frameMS.header.sense_node); - index += scnprintf(&driver_test_buff[index], - size - index, - "%02X%02X", - (ito_max_val[0] & 0xFF00) >> 8, - ito_max_val[0] & 0xFF); - - index += scnprintf(&driver_test_buff[index], - size - index, - "%02X%02X", - (ito_max_val[1] & 0xFF00) >> 8, - ito_max_val[1] & 0xFF); + if (funcToTest[0] == CMD_ITOTEST) { + index += scnprintf(&driver_test_buff[index], + size - index, + "%02X%02X", + (ito_max_val[0] & 0xFF00) >> 8, + ito_max_val[0] & 0xFF); + + index += scnprintf(&driver_test_buff[index], + size - index, + "%02X%02X", + (ito_max_val[1] & 0xFF00) >> 8, + ito_max_val[1] & 0xFF); + } for (j = 0; j < frameMS.node_data_size; j++) { index += scnprintf( |