From 2f13a231e309c4143d74a319c6d5ce7f3501f574 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> Date: Tue, 22 Aug 2006 18:24:03 +0000 Subject: usb benchmarking firmware git-svn-id: https://svn.openpcd.org:2342/trunk@116 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpcd/firmware/src/main_usb.c | 69 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 openpcd/firmware/src/main_usb.c diff --git a/openpcd/firmware/src/main_usb.c b/openpcd/firmware/src/main_usb.c new file mode 100644 index 0000000..1002db5 --- /dev/null +++ b/openpcd/firmware/src/main_usb.c @@ -0,0 +1,69 @@ +/* main_usb - OpenPCD test firmware for benchmarking USB performance + * (C) 2006 by Harald Welte + */ + +#include +#include +#include +#include "openpcd.h" +#include "rc632.h" +#include "dbgu.h" +#include "led.h" +#include "pwm.h" +#include "tc.h" +#include "ssc.h" +#include "pcd_enumerate.h" +#include "usb_handler.h" + +static char usb_buf1[64]; +static char usb_buf2[64]; +static struct req_ctx dummy_rctx1; + + +static void help(void) +{ +} + +void _init_func(void) +{ + DEBUGPCR("\r\n===> main_usb <===\r\n"); + help(); + + udp_init(); + + memset(usb_buf1, '1', sizeof(usb_buf1)); + memset(usb_buf2, '2', sizeof(usb_buf2)); + + dummy_rctx1.tx.tot_len = sizeof(usb_buf1); + memcpy(dummy_rctx1.tx.data, usb_buf1, sizeof(usb_buf1)); + +} + +int _main_dbgu(char key) +{ + switch (key) { + default: + return -EINVAL; + } + + return 0; +} + +void _main_func(void) +{ + /* first we try to get rid of pending to-be-sent stuff */ + //usb_out_process(); + + /* next we deal with incoming reqyests from USB EP1 (OUT) */ + //usb_in_process(); + + /* try unthrottling sources since we now are [more] likely to + * have empty request contexts */ + //udp_unthrottle(); + + while (udp_refill_ep(2, &dummy_rctx1) < 0) ; + + DEBUGP("S"); + + //led_toggle(2); +} -- cgit v1.2.3