diff options
Diffstat (limited to 'libmaple/usb/stm32f1/usb_reg_map.h')
-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) { |