X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fprotocol.c;h=17fe031db4b70587ce5f80c06b13002ca56f95c8;hb=6ec6c43b4738dbc7091f4a49a4ec80ea6102cb52;hp=c9e4e5d8bdbb076dfdc0706f87e10eeb1201d72e;hpb=f3f19d1131025b68d29a11273b627c83d748e7ea;p=libsigrok.git
diff --git a/src/hardware/pipistrello-ols/protocol.c b/src/hardware/pipistrello-ols/protocol.c
index c9e4e5d8..17fe031d 100644
--- a/src/hardware/pipistrello-ols/protocol.c
+++ b/src/hardware/pipistrello-ols/protocol.c
@@ -17,6 +17,7 @@
* along with this program. If not, see .
*/
+#include
#include "protocol.h"
extern SR_PRIV struct sr_dev_driver p_ols_driver_info;
@@ -505,7 +506,9 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data)
}
/* Clear out the most significant bit of the sample */
devc->tmp_sample[devc->num_bytes - 1] &= 0x7f;
- sr_spew("Expanded sample 1: 0x%.8x.", devc->tmp_sample);
+ sr_spew("Expanded sample 1: 0x%.2x%.2x%.2x%.2x.",
+ devc->tmp_sample[3], devc->tmp_sample[2],
+ devc->tmp_sample[1], devc->tmp_sample[0]);
/* expand second sample */
memset(devc->tmp_sample2, 0, 4);
@@ -521,7 +524,9 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data)
}
/* Clear out the most significant bit of the sample */
devc->tmp_sample2[devc->num_bytes - 1] &= 0x7f;
- sr_spew("Expanded sample 2: 0x%.8x.", devc->tmp_sample2);
+ sr_spew("Expanded sample 2: 0x%.2x%.2x%.2x%.2x.",
+ devc->tmp_sample2[3], devc->tmp_sample2[2],
+ devc->tmp_sample2[1], devc->tmp_sample2[0]);
/*
* OLS sends its sample buffer backwards.
@@ -619,8 +624,9 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data)
}
return TRUE;
} else {
- do bytes_read = ftdi_read_data(devc->ftdic, devc->ftdi_buf, FTDI_BUF_SIZE);
- while (bytes_read > 0);
+ do {
+ bytes_read = ftdi_read_data(devc->ftdic, devc->ftdi_buf, FTDI_BUF_SIZE);
+ } while (bytes_read > 0);
/*
* We've acquired all the samples we asked for -- we're done.