From f482e0618f309c5110bd3bd8b698a8cb4c9370cb Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 5 Apr 2011 00:19:03 +0200 Subject: [PATCH] use 64byte for messages --- firmware/src/usbhidrom_main.c | 6 ++++-- firmware/test.c | 2 +- firmware/test.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/firmware/src/usbhidrom_main.c b/firmware/src/usbhidrom_main.c index 86fb4bb..68b0877 100644 --- a/firmware/src/usbhidrom_main.c +++ b/firmware/src/usbhidrom_main.c @@ -35,15 +35,17 @@ ROM ** rom = (ROM **)0x1fff1ff8; /* --------------------------------------------------- */ -#define INSIZE 8 +#define INSIZE 64 #define OUTSIZE 2 void GetInReport (uint8_t src[], uint32_t length) { + static int j = 0; int i; for (i = 0; i < INSIZE; ++i) { - src[i] = 'A' + i; + src[i] = 'A' + i + j; } + if (++j>32) j = 0; } void SetOutReport (uint8_t dst[], uint32_t length) diff --git a/firmware/test.c b/firmware/test.c index 691f13e..b04e9d1 100644 --- a/firmware/test.c +++ b/firmware/test.c @@ -30,7 +30,7 @@ static const int PRODUCT_ID = 0x0003; // Values for bmRequestType in the Setup transaction's Data packet. -static const int INSIZE = 8; +static const int INSIZE = 64; static const int OUTSIZE = 2; static const int INTERFACE_NUMBER = 0; diff --git a/firmware/test.py b/firmware/test.py index 8e24d41..39b72f5 100755 --- a/firmware/test.py +++ b/firmware/test.py @@ -1,6 +1,7 @@ #!/usr/bin/python import usb +import time usbdev = usb.core.find(idVendor=0x1fc9, idProduct=0x0003) @@ -16,5 +17,6 @@ epi = usb.util.find_descriptor( custom_match = lambda e: \ usb.util.endpoint_direction(e.bEndpointAddress) == usb.util.ENDPOINT_IN) -print epo.write('@A') -print epi.read(8) +for i in xrange(1024): + epo.write('@A') + epi.read(64)