;\r
}\r
\r
+static void UsbSendStall(void)\r
+{\r
+ UDP_ENDPOINT_CSR(0) |= UDP_CSR_FORCE_STALL;\r
+\r
+ while(!(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT))\r
+ ;\r
+\r
+ UDP_ENDPOINT_CSR(0) &= ~UDP_CSR_STALL_SENT;\r
+\r
+ while(UDP_ENDPOINT_CSR(0) & UDP_CSR_STALL_SENT)\r
+ ;\r
+}\r
+\r
static void HandleRxdSetupData(void)\r
{\r
int i;\r
\r
case USB_REQUEST_CLEAR_FEATURE:\r
case USB_REQUEST_SET_FEATURE:\r
+ UsbSendStall();\r
+ break;\r
case USB_REQUEST_SET_DESCRIPTOR:\r
case USB_REQUEST_SYNC_FRAME:\r
default:\r
}\r
}\r
\r
+BOOL UsbConnected()\r
+{\r
+ if (UDP_GLOBAL_STATE & UDP_GLOBAL_STATE_CONFIGURED)\r
+ return TRUE;\r
+ else\r
+ return FALSE;\r
+}\r
+\r
BOOL UsbPoll(BOOL blinkLeds)\r
{\r
BOOL ret = FALSE;\r