谢谢二位朋友的帮忙,下面是代码
0x09,0x03, // USAGE ID - Vendor defined
0x15,0x00, // LOGICAL_MINIMUM (0)
0x26,0x00, 0xFF, // LOGICAL_MAXIMUM (255)
0x75,0x08, // REPORT_SIZE (8)
0x95,0x08, // REPORT_COUNT (20)
0x81,0x02, // INPUT (Data,Var,Abs)
//19
// The Output report
0x09,0x04, // USAGE ID - Vendor defined
0x15,0x00, // LOGICAL_MINIMUM (0)
0x26,0x00,0xFF, // LOGICAL_MAXIMUM (255)
0x75,0x08, // REPORT_SIZE (8)
0x95,0x08, // REPORT_COUNT (20)
0x91,0x02, // OUTPUT (Data,Var,Abs)
UserToPMABufferCopy(Transi_Buffer, ENDP2_TXADDR, 8);
SetEPTxValid(ENDP2);
如果设置都是8位,那上位机就接不到数据,但32确实只收了8位。
用BUS_HOUND 观察,会出现BUFOVERRUN。 |