aboutsummaryrefslogtreecommitdiff
path: root/libmaple/usb
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-04 00:15:39 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-04 00:18:14 -0400
commit6788dff2e0ba8a548b0a91b78c04031a4fc5df54 (patch)
tree91e4b0a39500686c23829f1ad6773df2b7bb3934 /libmaple/usb
parentb0a9e6fda2125bd252e2bf2ed43d93cec4f2dfe7 (diff)
Add FIXME for usb_get_ep_tx_count().
We definitely need to mask out the high bits, as RM0008 doesn't specify that they read as zero. Calling this function seems to crash the board, though. I'm not sure why, especially since usb_set_ep_tx_count(), used by usb_cdcacm.c, seems to work. Confusing. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb')
-rw-r--r--libmaple/usb/stm32f1/usb_reg_map.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmaple/usb/stm32f1/usb_reg_map.h b/libmaple/usb/stm32f1/usb_reg_map.h
index ce80842..ea483d2 100644
--- a/libmaple/usb/stm32f1/usb_reg_map.h
+++ b/libmaple/usb/stm32f1/usb_reg_map.h
@@ -377,7 +377,9 @@ static inline uint32* usb_ep_tx_count_ptr(uint8 ep) {
}
static inline uint16 usb_get_ep_tx_count(uint8 ep) {
- return (uint16)*usb_ep_tx_count_ptr(ep);
+ /* FIXME: this is broken somehow; calling it seems to
+ * confuse/crash the chip. */
+ return (uint16)(*usb_ep_tx_count_ptr(ep) & 0x3FF);
}
static inline void usb_set_ep_tx_count(uint8 ep, uint16 count) {