CH32V307的USB HS Device中CH372代码:
if(RingBuffer_Comm.RemainPack)
{
ret = USBHS_Endp_DataUp(DEF_UEP1, &Data_Buffer[(RingBuffer_Comm.DealPtr) * DEF_USBD_HS_PACK_SIZE], RingBuffer_Comm.PackLen[RingBuffer_Comm.DealPtr], DEF_UEP_DMA_LOAD);
if(ret == 0)
{
NVIC_DisableIRQ(USBHS_IRQn);
RingBuffer_Comm.RemainPack--;
RingBuffer_Comm.DealPtr++;
if(RingBuffer_Comm.DealPtr == DEF_Ring_Buffer_Max_Blks)
{
RingBuffer_Comm.DealPtr = 0;
}
NVIC_EnableIRQ(USBHS_IRQn);
}
}
1、没有在代码中看到RingBuffer_Comm的初始化部分;2、RingBuffer_Comm.PackLen[RingBuffer_Comm.DealPtr]这个数组到底是多大也看不出来。官方能否出个文档解释一下代码?