diff options
author | David Chiu <dchiu@synaptics.com> | 2021-12-21 14:09:02 +0800 |
---|---|---|
committer | Vincent Huang <vincenthsw@gmail.com> | 2021-12-22 15:12:10 +0800 |
commit | 386d65d4887fbc7a1b940041673e44a43baa8af6 (patch) | |
tree | 44bea2a9cb5db7f21c26121d7239fc8cf1ba75f0 | |
parent | b08492c1b59b77dc0f7d88089b36838331e867dd (diff) | |
download | rmi4utils-386d65d4887fbc7a1b940041673e44a43baa8af6.tar.gz |
Read attention before read flash status.
-rwxr-xr-x | rmi4update/rmi4update.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rmi4update/rmi4update.cpp b/rmi4update/rmi4update.cpp index ca05887..e05684e 100755 --- a/rmi4update/rmi4update.cpp +++ b/rmi4update/rmi4update.cpp @@ -384,6 +384,17 @@ int RMI4Update::ReadFlashConfig() if (rc != sizeof(cmd_buf)) return UPDATE_FAIL_WRITE_FLASH_COMMAND; + if(m_device.GetDeviceType() == RMI_DEVICE_TYPE_TOUCHPAD) { + // Sleep 20 ms and wait for attention for touchpad only. + Sleep(20); + rc = WaitForIdle(20, false); + if (rc != UPDATE_SUCCESS) { + fprintf(stderr, "%s: %s\n", __func__, update_err_to_string(rc)); + return UPDATE_FAIL_TIMEOUT_WAITING_FOR_ATTN; + } + fprintf(stdout, "Got attention\n"); + } + //Wait for completion do { Sleep(20); |