summaryrefslogtreecommitdiff
path: root/pc/usbtest.c
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2016-01-24 20:02:30 +0100
committerFlorian Jung <flo@windfisch.org>2016-01-24 20:02:30 +0100
commit07ce2df5da6265702e1d99556f46139f8b5b8611 (patch)
tree47a678a8806b3def6b95e84f9f6f10e2f5c813bb /pc/usbtest.c
parentdfc2f5fbfb5bb34d43fee7677486d8e8430f1f87 (diff)
write/verify scratchpad. proper formatting. warning comment.
Diffstat (limited to 'pc/usbtest.c')
-rw-r--r--pc/usbtest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pc/usbtest.c b/pc/usbtest.c
index 137180f..8ea2a62 100644
--- a/pc/usbtest.c
+++ b/pc/usbtest.c
@@ -176,9 +176,12 @@ int main(int argc, char **argv)
nBytes = usb_control_msg(handle,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
0x21, 0, 0, (char *)buffer, sizeof(buffer), 1000);
- printf("Got %d bytes: %s = \n", nBytes, buffer);
+ printf("Got %d bytes: %s = ", nBytes, buffer);
for (int i=0; i<nBytes; i++)
+ {
+ if (i%16 == 0) printf("\n");
printf("%.2X ",buffer[i] & 0xFF);
+ }
printf("\n");
}
else if (mode == MODE_WRITE)
@@ -198,9 +201,12 @@ int main(int argc, char **argv)
nBytes = usb_control_msg(handle,
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN,
0x21, 0, 0, (char *)buffer, sizeof(buffer), 1000);
- printf("Got %d bytes: %s = \n", nBytes, buffer);
+ printf("Got %d bytes: %s = ", nBytes, buffer);
for (int i=0; i<nBytes; i++)
+ {
+ if (i%16 == 0) printf("\n");
printf("%.2X ",buffer[i] & 0xFF);
+ }
printf("\n");
}