aboutsummaryrefslogtreecommitdiff
path: root/lib/usb/usb_f103.c
diff options
context:
space:
mode:
authorMartin Mueller2010-11-04 00:41:49 +0100
committerMartin Mueller2010-11-04 00:44:47 +0100
commitd6eacce827a8ebffb5e82b48d4c88eb097594c1e (patch)
treed8991b96fc575925ee6f632bf7e5925d46b5cfc3 /lib/usb/usb_f103.c
parent6e090ccee16582f0c152c95238753562732788e3 (diff)
add standard request
Diffstat (limited to 'lib/usb/usb_f103.c')
-rw-r--r--lib/usb/usb_f103.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/usb/usb_f103.c b/lib/usb/usb_f103.c
index e4cf06e..1af4493 100644
--- a/lib/usb/usb_f103.c
+++ b/lib/usb/usb_f103.c
@@ -116,7 +116,22 @@ void usbd_ep_stall(u8 addr)
if(addr & 0x80)
USB_SET_EP_TX_STAT(addr, USB_EP_TX_STAT_STALL);
else
- USB_SET_EP_RX_STAT(addr & 0x7F, USB_EP_RX_STAT_STALL);
+ USB_SET_EP_RX_STAT(addr&0x7F, USB_EP_RX_STAT_STALL);
+}
+
+u8 usbd_get_ep_stall(u8 addr)
+{
+ if(addr == 0)
+ if ((*USB_EP_REG(addr) & USB_EP_TX_STAT) == USB_EP_TX_STAT_STALL)
+ return 1;
+ if(addr & 0x80) {
+ if ((*USB_EP_REG(addr) & USB_EP_TX_STAT) == USB_EP_TX_STAT_STALL)
+ return 1;
+ } else {
+ if ((*USB_EP_REG(addr&0x7F) & USB_EP_RX_STAT) == USB_EP_RX_STAT_STALL)
+ return 1;
+ }
+ return 0;
}
/** Copy a data buffer to Packet Memory.