summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-08-22 18:24:03 +0000
committer(no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-08-22 18:24:03 +0000
commit2f13a231e309c4143d74a319c6d5ce7f3501f574 (patch)
tree97c48ead70f2a9408539e43f43a63fbfd23c7cf8
parent37907554771641fd6eaf0e24175f8944b2efcdaa (diff)
usb benchmarking firmware
git-svn-id: https://svn.openpcd.org:2342/trunk@116 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r--openpcd/firmware/src/main_usb.c69
1 files changed, 69 insertions, 0 deletions
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 <laforge@gnumonks.org>
+ */
+
+#include <errno.h>
+#include <string.h>
+#include <lib_AT91SAM7.h>
+#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);
+}
personal git repositories of Harald Welte. Your mileage may vary