diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-04 00:15:39 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-08-04 00:18:14 -0400 |
commit | 23918555b0eb87922b813590b8f8773acf834caf (patch) | |
tree | 91e4b0a39500686c23829f1ad6773df2b7bb3934 | |
parent | 770a072e16a410511e0e2fa88dbde23bb0a8ba24 (diff) | |
download | librambutan-23918555b0eb87922b813590b8f8773acf834caf.tar.gz librambutan-23918555b0eb87922b813590b8f8773acf834caf.zip |
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>
-rw-r--r-- | libmaple/usb/stm32f1/usb_reg_map.h | 4 |
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) { |