阅读:1034回复:0
cy68013数据重复接收问题
我用端点4out发送~端点8接收 数据会有重复。比如端点4发送1 2 3 4,此时端点8可以正常接收。再次使用端点4发送5 6 7 8,这时端点8会先接收到1 2 3 4两次,之后才能正常收到
5 6 7 8 请问这是什么问题? 代码如下 if(!(EP2468STAT & bmEP4EMPTY)) { APTR1H = MSB( &EP4FIFOBUF ); APTR1L = LSB( &EP4FIFOBUF ); AUTOPTRH2 = MSB( &myBuffer ); AUTOPTRL2 = LSB( &myBuffer ); myBufferCount = (EP4BCH << 8) + EP4BCL; for( i = 0x0000; i < myBufferCount; i++ ) { //使用AUTOPOINTER(s) EXTAUTODAT2 = EXTAUTODAT1; } SYNCDELAY; // EP4BCL = 0x80; // re(arm) EP4OUT } if(!(EP2468STAT & bmEP8FULL) && myBufferCount) { APTR1H = MSB( &myBuffer ); APTR1L = LSB( &myBuffer ); AUTOPTRH2 = MSB( &EP8FIFOBUF ); AUTOPTRL2 = LSB( &EP8FIFOBUF ); for( i = 0x0000; i < myBufferCount; i++ ) { EXTAUTODAT2 = EXTAUTODAT1; } SYNCDELAY; // EP8BCH = MSB(myBufferCount); SYNCDELAY; // EP8BCL = LSB(myBufferCount); // arm EP8IN } } |
|