mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
the renumerations of USB seems to time critical. Prolonging the delay seems to improve it. Thanks to @NVX / @HenryGab for looking into it
This commit is contained in:
parent
f4f832e121
commit
e41019e584
1 changed files with 7 additions and 1 deletions
|
@ -212,6 +212,12 @@ static void UsbPacketReceived(uint8_t *packet) {
|
|||
reply_old(CMD_ACK, arg0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// delay_loop(1) = 3.07us
|
||||
static volatile uint32_t c;
|
||||
static void __attribute__((optimize("O0"))) delay_loop(uint32_t delay) {
|
||||
for (c = delay * 2; c; c--) {};
|
||||
}
|
||||
|
||||
static void flash_mode(void) {
|
||||
start_addr = 0;
|
||||
end_addr = 0;
|
||||
|
@ -234,7 +240,7 @@ static void flash_mode(void) {
|
|||
usb_enable();
|
||||
|
||||
// wait for reset to be complete?
|
||||
for (volatile size_t i = 0; i < 0x100000; i++) {};
|
||||
delay_loop(100000);
|
||||
|
||||
for (;;) {
|
||||
WDT_HIT();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue