how to renew the data in endpoint 4 | Cypress Semiconductor
how to renew the data in endpoint 4
I try to transmit the data from endpoint 4 (out) to ram ,and then to endpoint 8(IN).according the debug,data can be passed rightly one to one,but if receive not in time, I can't get the latest data.
for example:4(in) transmit: 90 (512bytes) 8(IN) get 90 to FF,then from 00 to 8F (that's right);
then 4(in) transmit: 93 (512bytes) 8(IN) get 93 to FF,then from 00 to 92 (that's right);
then 4(in) transmit: 95 (512bytes) 8(IN) get 95 to FF,then from 00 to 94 (that's right);
but if I transmit 90(512bytes),then 93(512bytes),then 95(512bytes), I only can get the old data 90 to 8f and 93 to 92, but the latest data is lost.how can I ignore the old data and get latest one?
here's the code,debug by consle
if(!(EP2468STAT & bmEP4EMPTY))
count = (EP4BCH << 8) + EP4BCL;
// loop EP4OUT buffer data to RAMBUF
for( i = 0x0000; i < count; i++ )
for( i = 0x00; i < count; i++ )
EP8BCH = 0x02;
EP8BCL = 0x00;