diff options
author | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-08 17:21:49 +0000 |
---|---|---|
committer | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-08 17:21:49 +0000 |
commit | a5c8f60f59efa3259c02353c18e4b717b8dca66f (patch) | |
tree | 085b08450e13b366f1ef7810beed0bd745e236eb | |
parent | 14055f6e670862ee5aa204d70654e75226d523c3 (diff) |
move more usb related handling into usb_handler.c
git-svn-id: https://svn.openpcd.org:2342/trunk@84 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r-- | openpcd/firmware/src/main_dumbreader.c | 16 | ||||
-rw-r--r-- | openpcd/firmware/src/usb_handler.c | 19 |
2 files changed, 20 insertions, 15 deletions
diff --git a/openpcd/firmware/src/main_dumbreader.c b/openpcd/firmware/src/main_dumbreader.c index 54d7819..d9172ed 100644 --- a/openpcd/firmware/src/main_dumbreader.c +++ b/openpcd/firmware/src/main_dumbreader.c @@ -23,22 +23,8 @@ int _main_dbgu(char key) void _main_func(void) { - struct req_ctx *rctx; - /* first we try to get rid of pending to-be-sent stuff */ - while (rctx = req_ctx_find_get(RCTX_STATE_UDP_EP3_PENDING, - RCTX_STATE_UDP_EP3_BUSY)) { - DEBUGPCRF("EP3_BUSY for ctx %u", req_ctx_num(rctx)); - if (udp_refill_ep(3, rctx) < 0) - req_ctx_set_state(rctx, RCTX_STATE_UDP_EP3_PENDING); - } - - while (rctx = req_ctx_find_get(RCTX_STATE_UDP_EP2_PENDING, - RCTX_STATE_UDP_EP2_BUSY)) { - DEBUGPCRF("EP2_BUSY for ctx %u", req_ctx_num(rctx)); - if (udp_refill_ep(2, rctx) < 0) - req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); - } + usb_out_process(); /* next we deal with incoming reqyests from USB EP1 (OUT) */ usb_in_process(); diff --git a/openpcd/firmware/src/usb_handler.c b/openpcd/firmware/src/usb_handler.c index dc5632e..4068486 100644 --- a/openpcd/firmware/src/usb_handler.c +++ b/openpcd/firmware/src/usb_handler.c @@ -133,6 +133,25 @@ respond: return 1; } +void usb_out_process(void) +{ + struct req_ctx *rctx; + + while (rctx = req_ctx_find_get(RCTX_STATE_UDP_EP3_PENDING, + RCTX_STATE_UDP_EP3_BUSY)) { + DEBUGPCRF("EP3_BUSY for ctx %u", req_ctx_num(rctx)); + if (udp_refill_ep(3, rctx) < 0) + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP3_PENDING); + } + + while (rctx = req_ctx_find_get(RCTX_STATE_UDP_EP2_PENDING, + RCTX_STATE_UDP_EP2_BUSY)) { + DEBUGPCRF("EP2_BUSY for ctx %u", req_ctx_num(rctx)); + if (udp_refill_ep(2, rctx) < 0) + req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING); + } +} + void usb_in_process(void) { struct req_ctx *rctx; |