mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-05 04:25:20 +08:00
Fix some wrong synchronization waits in usb_write()
To make the full use of the ping-pong endpoint Transfer speed before this fix: 616448,618496,618496,615424,615424->616857.6 bytes/s Transfer speed after this fix: 707584,709632,707584,709632,710656->709017.6 bytes/s (+14.9%) Tested by running hw status
This commit is contained in:
parent
e20742dd04
commit
72da0c9623
1 changed files with 2 additions and 2 deletions
|
@ -797,7 +797,7 @@ int usb_write(const uint8_t *data, const size_t len) {
|
||||||
while (pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXCOMP) {};
|
while (pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXCOMP) {};
|
||||||
|
|
||||||
UDP_SET_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXPKTRDY);
|
UDP_SET_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXPKTRDY);
|
||||||
while (pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXPKTRDY) {};
|
while (!(pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXPKTRDY)) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the end of transfer
|
// Wait for the end of transfer
|
||||||
|
@ -812,7 +812,7 @@ int usb_write(const uint8_t *data, const size_t len) {
|
||||||
if (len % AT91C_EP_IN_SIZE == 0) {
|
if (len % AT91C_EP_IN_SIZE == 0) {
|
||||||
|
|
||||||
UDP_SET_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXPKTRDY);
|
UDP_SET_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXPKTRDY);
|
||||||
while (!(pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXCOMP)) {};
|
while (!(pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXPKTRDY)) {};
|
||||||
|
|
||||||
UDP_CLEAR_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXCOMP);
|
UDP_CLEAR_EP_FLAGS(AT91C_EP_IN, AT91C_UDP_TXCOMP);
|
||||||
while (pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXCOMP) {};
|
while (pUdp->UDP_CSR[AT91C_EP_IN] & AT91C_UDP_TXCOMP) {};
|
||||||
|
|
Loading…
Reference in a new issue