/* Clear USB Device Endpoint Buffer Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClearEPBuf(uint32_t EPNum)
/* Clear USB Device Endpoint Buffer Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClearEPBuf(uint32_t EPNum)
{
    uint32_t  cnt, i;
    uint8_t  *dataptr;
    if (EPNum & USB_IN_MASK) {
        EPNum &= ~USB_IN_MASK;
        dataptr = (uint8_t *)EPBufInfo[EP_IN_IDX(EPNum)].buf_ptr;
        cnt     =       EPBufInfo[EP_IN_IDX(EPNum)].buf_len;
        for (i = 0; i < cnt; i++) {
            dataptr[i] = 0;
        }
    } else {
        dataptr = (uint8_t *)EPBufInfo[EP_OUT_IDX(EPNum)].buf_ptr;
        cnt     =       EPBufInfo[EP_OUT_IDX(EPNum)].buf_len;
        for (i = 0; i < cnt; i++) {
            dataptr[i] = 0;
        }
    }
}