for (ii=0;ii<nReportCnt;ii++) Transi_Buffer[ii] = 0x00;
PC 端接收完成產生中斷事件, 清出除舊資料
//////////////////////////////////////////////////////////////////
//for LED test
if (GPIOA->ODR & 0x0c ) GPIOA->ODR &= (~0x0c);
else GPIOA->ODR |= 0x0c;
可能是發送完成 led 反向 亮一下,但我沒去試, 應可有可無 //for LED test
ALIENTEK USB PC Ver2.rar 是收發
22 字節
更新的 ALIENTEK USB PC Ver3.rar才是收發 64
字節
void EP1_OUT_Callback(void)
{
USB_ReceiveFlg = TRUE;
 

MAToUserBufferCopy(Receive_Buffer, ENDP1_RXADDR,nReportCnt);
//nReportCnt 設定收發字節長度
MsgCmd = Receive_Buffer[21]; //未知用途
SetEPRxStatus(ENDP1, EP_RX_VALID);
}
void EP2_IN_Callback(void)
{
u8 ii;
for (ii=0;ii<nReportCnt;ii++) Transi_Buffer[ii] = 0x00; //nReportCnt 設定收發字節長度
//for LED test
if (GPIOA->ODR & 0x0c ) GPIOA->ODR &= (~0x0c);
else GPIOA->ODR |= 0x0c;
}
(學習 STM32 至今天, 還不到三個月)