mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
FIX: bootrom - flashmode should also not assume sizeof(usbcommand) 544 bytes
This commit is contained in:
parent
16028f7d33
commit
d46955e309
2 changed files with 12 additions and 9 deletions
|
@ -191,7 +191,7 @@ static void flash_mode(int externally_entered) {
|
|||
end_addr = 0;
|
||||
bootrom_unlocked = 0;
|
||||
byte_t rx[sizeof(UsbCommand)];
|
||||
size_t rx_len;
|
||||
//size_t rx_len;
|
||||
|
||||
usb_enable();
|
||||
//for (volatile size_t i=0; i<0x100000; i++) {};
|
||||
|
@ -199,11 +199,15 @@ static void flash_mode(int externally_entered) {
|
|||
for(;;) {
|
||||
WDT_HIT();
|
||||
|
||||
if ( usb_poll_validate_length()) {
|
||||
rx_len = usb_read(rx, sizeof(UsbCommand));
|
||||
if (rx_len == sizeof(UsbCommand))
|
||||
UsbPacketReceived(rx, rx_len);
|
||||
}
|
||||
// Check if there is a usb packet available
|
||||
if ( cmd_receive( (UsbCommand*)rx ) )
|
||||
UsbPacketReceived(rx, sizeof(UsbCommand) );
|
||||
|
||||
// if ( usb_poll_validate_length()) {
|
||||
// rx_len = usb_read(rx, sizeof(UsbCommand));
|
||||
// if (rx_len)
|
||||
// UsbPacketReceived(rx, rx_len);
|
||||
//}
|
||||
|
||||
if (!externally_entered && !BUTTON_PRESS()) {
|
||||
/* Perform a reset to leave flash mode */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue