/* Clear Stall for USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClrStallEP(uint32_t EPNum)
/* Clear Stall for USB Device Endpoint Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClrStallEP(uint32_t EPNum)
{
    uint32_t *ptr;
    ptr = GetEpCmdStatPtr(EPNum);
    if (EPNum & USB_IN_MASK) {
        *ptr &=  ~EP_STALL;
    } else {
        *ptr &=  ~EP_STALL;
        *ptr |=   EP_BUF_ACTIVE;
    }
    USBD_ResetEP(EPNum);
}