unsigned char USBD_Stall(unsigned char bEndpoint) { Endpoint *pEndpoint = &(endpoints[bEndpoint]); // Check that endpoint is in Idle state if (pEndpoint->state != UDP_ENDPOINT_IDLE) { TRACE_WARNING("UDP_Stall: Endpoint%d locked\n\r", bEndpoint); return USBD_STATUS_LOCKED; } TRACE_DEBUG_WP("Stall%d ", bEndpoint); SET_CSR(bEndpoint, AT91C_UDP_FORCESTALL); return USBD_STATUS_SUCCESS; }