/* Clears the correct reception flag (bank 0 or bank 1) of an endpoint  */
static void UDP_ClearRxFlag(unsigned char bEndpoint)
/* Clears the correct reception flag (bank 0 or bank 1) of an endpoint  */
static void UDP_ClearRxFlag(unsigned char bEndpoint)
{
    Endpoint *pEndpoint = &(endpoints[bEndpoint]);
    if (pEndpoint->bank == 0) {
        CLEAR_CSR(bEndpoint, UDP_CSR_RX_DATA_BK0);
        if (CHIP_USB_ENDPOINTS_BANKS(bEndpoint) > 1) {
            pEndpoint->bank = 1;
        }
    }
    else {
        CLEAR_CSR(bEndpoint, UDP_CSR_RX_DATA_BK1);
        pEndpoint->bank = 0;
    }
}