aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb/stm32f1/usb_reg_map.c
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2013-01-17 17:48:47 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2013-01-17 17:49:24 -0500
commite7eac89b679f4dda632ff45da135207dbc1c8edb (patch)
tree60bca801de0f309d99cd652042868ce22516e236 /libmaple/usb/stm32f1/usb_reg_map.c
parenta731953b8522c010ceb076dc7cf116ff3250df26 (diff)
parent0676b01a984b999fed54f906373078ba48b50b6f (diff)
downloadlibrambutan-e7eac89b679f4dda632ff45da135207dbc1c8edb.tar.gz
librambutan-e7eac89b679f4dda632ff45da135207dbc1c8edb.zip
Merge branch 'dbl-buf-usb'
For bulk double buffer support. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb/stm32f1/usb_reg_map.c')
-rw-r--r--libmaple/usb/stm32f1/usb_reg_map.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libmaple/usb/stm32f1/usb_reg_map.c b/libmaple/usb/stm32f1/usb_reg_map.c
index 75562e1..ea60cb3 100644
--- a/libmaple/usb/stm32f1/usb_reg_map.c
+++ b/libmaple/usb/stm32f1/usb_reg_map.c
@@ -58,8 +58,7 @@ void usb_copy_from_pma(uint8 *buf, uint16 len, uint16 pma_offset) {
}
}
-void usb_set_ep_rx_count(uint8 ep, uint16 count) {
- uint32 *rxc = usb_ep_rx_count_ptr(ep);
+static void usb_set_ep_rx_count_common(uint32 *rxc, uint16 count) {
uint16 nblocks;
if (count > 62) {
/* use 32-byte memory block size */
@@ -77,3 +76,13 @@ void usb_set_ep_rx_count(uint8 ep, uint16 count) {
*rxc = nblocks << 10;
}
}
+
+void usb_set_ep_rx_buf0_count(uint8 ep, uint16 count) {
+ uint32 *rxc = usb_ep_rx_buf0_count_ptr(ep);
+ usb_set_ep_rx_count_common(rxc, count);
+}
+
+void usb_set_ep_rx_count(uint8 ep, uint16 count) {
+ uint32 *rxc = usb_ep_rx_count_ptr(ep);
+ usb_set_ep_rx_count_common(rxc, count);
+}