aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2013-01-17 17:47:27 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2013-01-17 17:47:27 -0500
commit91362dbfc0dc4783048da07f76d32f5304d13a89 (patch)
treefcf08cc318457d743248d89b3993dadda85998e1
parent24465f8e1779a9da54d03c5600da323bcdfab556 (diff)
downloadlibrambutan-91362dbfc0dc4783048da07f76d32f5304d13a89.tar.gz
librambutan-91362dbfc0dc4783048da07f76d32f5304d13a89.zip
usb_reg_map.h: Fix incorrect register bit definitions.
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/usb/stm32f1/usb_reg_map.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libmaple/usb/stm32f1/usb_reg_map.h b/libmaple/usb/stm32f1/usb_reg_map.h
index 412a741..2e3f6bc 100644
--- a/libmaple/usb/stm32f1/usb_reg_map.h
+++ b/libmaple/usb/stm32f1/usb_reg_map.h
@@ -70,7 +70,7 @@ typedef struct usb_reg_map {
#define USB_EP_CTR_RX_BIT 15
#define USB_EP_DTOG_RX_BIT 14
#define USB_EP_SETUP_BIT 11
-#define USB_EP_EP_KIND_DBL_BUF_BIT 8
+#define USB_EP_EP_KIND_BIT 8
#define USB_EP_CTR_TX_BIT 7
#define USB_EP_DTOG_TX_BIT 6
@@ -87,8 +87,8 @@ typedef struct usb_reg_map {
#define USB_EP_EP_TYPE_CONTROL (0x1 << 9)
#define USB_EP_EP_TYPE_ISO (0x2 << 9)
#define USB_EP_EP_TYPE_INTERRUPT (0x3 << 9)
-#define USB_EP_EP_KIND_DBL_BUF BIT(USB_EP_EP_KIND_DBL_BUF_BIT)
-#define USB_EP_EP_DBL_BUF USB_EP_EP_KIND_DBL_BUF
+#define USB_EP_EP_KIND BIT(USB_EP_EP_KIND_BIT)
+#define USB_EP_EP_KIND_DBL_BUF (0x1 << USB_EP_EP_KIND_BIT)
#define USB_EP_CTR_TX BIT(USB_EP_CTR_TX_BIT)
#define USB_EP_DTOG_TX BIT(USB_EP_DTOG_TX_BIT)
#define USB_EP_STAT_TX (0x3 << 4)
@@ -193,7 +193,7 @@ typedef struct usb_reg_map {
#define __EP_CTR_NOP (USB_EP_CTR_RX | USB_EP_CTR_TX)
#define __EP_NONTOGGLE (USB_EP_CTR_RX | USB_EP_SETUP | \
- USB_EP_EP_TYPE | USB_EP_EP_KIND_DBL_BUF | \
+ USB_EP_EP_TYPE | USB_EP_EP_KIND | \
USB_EP_CTR_TX | USB_EP_EA)
static inline void usb_clear_ctr_rx(uint8 ep) {
@@ -311,7 +311,7 @@ static inline void usb_set_ep_type(uint8 ep, uint32 type) {
static inline void usb_set_ep_kind(uint8 ep, uint32 kind) {
uint32 epr = USB_BASE->EP[ep];
- epr &= ~USB_EP_EP_KIND_DBL_BUF & __EP_NONTOGGLE;
+ epr &= ~USB_EP_EP_KIND & __EP_NONTOGGLE;
epr |= kind;
USB_BASE->EP[ep] = epr;
}