/* Clear USB Device Endpoint Buffer Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClearEPBuf(U32 EPNum)
/* Clear USB Device Endpoint Buffer Parameters: EPNum: Device Endpoint Number EPNum.0..3: Address EPNum.7: Dir Return Value: None  */
void USBD_ClearEPBuf(U32 EPNum)
{
    U32  cnt, i;
    U8  *dataptr;
    if (EPNum & 0x80) {
        EPNum &= ~0x80;
        dataptr = (U8 *)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 = (U8 *)EPBufInfo[EP_OUT_IDX(EPNum)].buf_ptr;
        cnt     =       EPBufInfo[EP_OUT_IDX(EPNum)].buf_len;
        for (i = 0; i < cnt; i++) {
            dataptr[i] = 0;
        }
    }
}