是根据MCU例程代码里IN 令牌后发,MCU发送出去的数据决定的
if(g_u32BytesInPageBuf == 0)
{
/* The previous page has sent out. Read new page to page buffer */
/* TODO: We should update new page data here. (0xFF is used in this sample code) */
printf("Reading page %dn", u32StartPage + u32PageCnt);
for(i=0; i
g_u8PageBuff
= 0xFF;
g_u32BytesInPageBuf = PAGE_SIZE;
/* Update the page counter */
u32PageCnt++;
}
/* Prepare the data for next HID IN transfer */
len = Minimum(g_u32EpAMaxPacketSize, g_u32BytesInPageBuf);
for (i=0; i
HSUSBD->EP[EPA].EPDAT_BYTE = g_u8PageBuff[PAGE_SIZE - g_u32BytesInPageBuf];
HSUSBD->EP[EPA].EPTXCNT = len;
HSUSBD_ENABLE_EP_INT(EPA, HSUSBD_EPINTEN_INTKIEN_Msk);
g_u32BytesInPageBuf -= len;
}
是根据MCU例程代码里IN 令牌后发,MCU发送出去的数据决定的
if(g_u32BytesInPageBuf == 0)
{
/* The previous page has sent out. Read new page to page buffer */
/* TODO: We should update new page data here. (0xFF is used in this sample code) */
printf("Reading page %dn", u32StartPage + u32PageCnt);
for(i=0; i
g_u8PageBuff
= 0xFF;
g_u32BytesInPageBuf = PAGE_SIZE;
/* Update the page counter */
u32PageCnt++;
}
/* Prepare the data for next HID IN transfer */
len = Minimum(g_u32EpAMaxPacketSize, g_u32BytesInPageBuf);
for (i=0; i
HSUSBD->EP[EPA].EPDAT_BYTE = g_u8PageBuff[PAGE_SIZE - g_u32BytesInPageBuf];
HSUSBD->EP[EPA].EPTXCNT = len;
HSUSBD_ENABLE_EP_INT(EPA, HSUSBD_EPINTEN_INTKIEN_Msk);
g_u32BytesInPageBuf -= len;
}
举报