openpcd/firmware/src/pcd/main_usb.c @ master
1 |
/* main_usb - OpenPCD test firmware for benchmarking USB performance
|
---|---|
2 |
* (C) 2006 by Harald Welte <laforge@gnumonks.org>
|
3 |
*/
|
4 |
|
5 |
#include <errno.h>
|
6 |
#include <string.h>
|
7 |
#include <lib_AT91SAM7.h>
|
8 |
#include <openpcd.h>
|
9 |
#include <os/dbgu.h>
|
10 |
#include <os/led.h>
|
11 |
#include <os/pcd_enumerate.h>
|
12 |
#include <os/usb_handler.h>
|
13 |
|
14 |
static void help(void) |
15 |
{
|
16 |
}
|
17 |
|
18 |
int _main_dbgu(char key) |
19 |
{
|
20 |
switch (key) { |
21 |
default:
|
22 |
return -EINVAL; |
23 |
}
|
24 |
|
25 |
return 0; |
26 |
}
|
27 |
|
28 |
void _init_func(void) |
29 |
{
|
30 |
usbtest_init(); |
31 |
}
|
32 |
|
33 |
void _main_func(void) |
34 |
{
|
35 |
/* first we try to get rid of pending to-be-sent stuff */
|
36 |
usb_out_process(); |
37 |
|
38 |
/* next we deal with incoming requests from USB EP1 (OUT) */
|
39 |
usb_in_process(); |
40 |
|
41 |
/* try unthrottling sources since we now are [more] likely to
|
42 |
* have empty request contexts */
|
43 |
udp_unthrottle(); |
44 |
}
|