diff options
author | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-08 22:35:42 +0000 |
---|---|---|
committer | (no author) <(no author)@6dc7ffe9-61d6-0310-9af1-9938baff3ed1> | 2006-08-08 22:35:42 +0000 |
commit | fda97c65bf12e1f817b99959b8d3a7ab0ae52567 (patch) | |
tree | 115be42a5f60e9aead18f2f8fcf6649bc8aeea50 | |
parent | de8cee9bed8f3362d499a127b8cf5a4d012e8ec5 (diff) |
add automatic throttling and manual un-throttling support
git-svn-id: https://svn.openpcd.org:2342/trunk@92 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r-- | openpcd/firmware/src/ssc.c | 12 | ||||
-rw-r--r-- | openpcd/firmware/src/ssc.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/openpcd/firmware/src/ssc.c b/openpcd/firmware/src/ssc.c index 4c840b6..c9deb79 100644 --- a/openpcd/firmware/src/ssc.c +++ b/openpcd/firmware/src/ssc.c @@ -88,13 +88,23 @@ static void ssc_irq(void) req_ctx_set_state(ssc_state.rx_ctx[0], RCTX_STATE_UDP_EP2_PENDING); } - ssc_rx_refill(); + if (ssc_rx_refill() == -1) + AT91F_AIC_DisableIt(ssc, AT91C_SSC_ENDRX | + AT91C_SSC_TXBUFE | + AT91C_SSC_OVRUN); } if (ssc_sr & AT91C_SSC_OVRUN) DEBUGPCRF("Rx Overrun, shouldn't happen!"); } + +void ssc_rx_unthrottle(void) +{ + AT91F_AIC_EnableIt(ssc, AT91C_SSC_ENDRX | + AT91C_SSC_TXBUFE | AT91C_SSC_OVRUN); +} + void ssc_rx_start(void) { DEBUGPCRF("starting SSC RX\n"); diff --git a/openpcd/firmware/src/ssc.h b/openpcd/firmware/src/ssc.h index 73450ab..710ee45 100644 --- a/openpcd/firmware/src/ssc.h +++ b/openpcd/firmware/src/ssc.h @@ -10,4 +10,6 @@ extern void ssc_rx_init(void); extern void ssc_fini(void); +extern void ssc_rx_unthrottle(void); + #endif |