fix "Sending bytes to proxmark failed" after BUTTON_PRESS() 909/head
authorpwpiwi <pwpiwi@users.noreply.github.com>
Fri, 10 Jan 2020 07:33:50 +0000 (08:33 +0100)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Fri, 10 Jan 2020 07:45:45 +0000 (08:45 +0100)
armsrc/appmain.c

index 6a3b6e8199e8339a4d3dec81c1a544e8d74b25de..70cabd2e20bfc00d8106a8c6443984db7135fb9a 100644 (file)
@@ -1483,25 +1483,18 @@ void  __attribute__((noreturn)) AppMain(void) {
        size_t rx_len;
 
        for(;;) {
        size_t rx_len;
 
        for(;;) {
-               if (usb_poll()) {
-                       rx_len = usb_read(rx, sizeof(UsbCommand));
-                       if (rx_len) {
-                               UsbPacketReceived(rx, rx_len);
-                       }
-               }
                WDT_HIT();
                WDT_HIT();
-
-#ifdef WITH_LF_StandAlone
-#ifndef WITH_ISO14443a_StandAlone
-               if (BUTTON_HELD(1000) > 0)
-                       SamyRun();
-#endif
-#endif
-#ifdef WITH_ISO14443a
-#ifdef WITH_ISO14443a_StandAlone
-               if (BUTTON_HELD(1000) > 0)
-                       StandAloneMode14a();
+               if (usb_poll() && (rx_len = usb_read(rx, sizeof(rx)))) {
+                       UsbPacketReceived(rx, rx_len);
+               } else {
+#if defined(WITH_LF_StandAlone) && !defined(WITH_ISO14443a_StandAlone)
+                       if (BUTTON_HELD(1000) > 0)
+                               SamyRun();
 #endif
 #endif
+#if defined(WITH_ISO14443a) && defined(WITH_ISO14443a_StandAlone)
+                       if (BUTTON_HELD(1000) > 0)
+                               StandAloneMode14a();
 #endif
 #endif
+               }
        }
 }
        }
 }
Impressum, Datenschutz