X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/1d04b933df776bf60489b67bb5c9b806e308dfc8..6b34699adc3fb9821a5053c1f863957c52998729:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 6a3b6e81..70cabd2e 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1483,25 +1483,18 @@ void __attribute__((noreturn)) AppMain(void) { size_t rx_len; for(;;) { - if (usb_poll()) { - rx_len = usb_read(rx, sizeof(UsbCommand)); - if (rx_len) { - UsbPacketReceived(rx, rx_len); - } - } 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 +#if defined(WITH_ISO14443a) && defined(WITH_ISO14443a_StandAlone) + if (BUTTON_HELD(1000) > 0) + StandAloneMode14a(); #endif + } } }