aboutsummaryrefslogtreecommitdiff
path: root/rmidevice/rmidevice.cpp
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2017-03-27 20:30:07 -0700
committerAndrew Duggan <aduggan@synaptics.com>2017-03-30 09:37:58 -0700
commit3781959e23f79fec610e87cfbc3a43c6b24ea7ba (patch)
tree72472b4556d85635ae23648e670588f72a4354dd /rmidevice/rmidevice.cpp
parentf1abc1116e2adeb14de3439c347c2e9a78428f19 (diff)
downloadrmi4utils-3781959e23f79fec610e87cfbc3a43c6b24ea7ba.tar.gz
Consolidate utility functions into the rmidevice library
Diffstat (limited to 'rmidevice/rmidevice.cpp')
-rw-r--r--rmidevice/rmidevice.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/rmidevice/rmidevice.cpp b/rmidevice/rmidevice.cpp
index 668301c..15335f9 100644
--- a/rmidevice/rmidevice.cpp
+++ b/rmidevice/rmidevice.cpp
@@ -345,43 +345,4 @@ bool RMIDevice::InBootloader()
return !!(status & 0x40);
}
return true;
-}
-
-long long diff_time(struct timespec *start, struct timespec *end)
-{
- long long diff;
- diff = (end->tv_sec - start->tv_sec) * 1000 * 1000;
- diff += (end->tv_nsec - start->tv_nsec) / 1000;
- return diff;
-}
-
-int Sleep(int ms)
-{
- struct timespec ts;
- struct timespec rem;
-
- ts.tv_sec = ms / 1000;
- ts.tv_nsec = (ms % 1000) * 1000 * 1000;
- for (;;) {
- if (nanosleep(&ts, &rem) == 0) {
- break;
- } else {
- if (errno == EINTR) {
- ts = rem;
- continue;
- }
- return -1;
- }
- }
- return 0;
-}
-
-void print_buffer(const unsigned char *buf, unsigned int len)
-{
- for (unsigned int i = 0; i < len; ++i) {
- fprintf(stdout, "0x%02X ", buf[i]);
- if (i % 8 == 7)
- fprintf(stdout, "\n");
- }
- fprintf(stdout, "\n");
-}
+} \ No newline at end of file