X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/cd00aa3043b507ed10bf79a37b83b88741d176d7..55a69489cd8a437c13cf715248a4e6c200512941:/client/proxmark3.c?ds=sidebyside diff --git a/client/proxmark3.c b/client/proxmark3.c index 3c3b7927..2e8ef418 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -9,7 +9,6 @@ #include #include -#include "translate.h" #include "prox.h" #include "proxmark3.h" #include "proxgui.h" @@ -27,7 +26,7 @@ static void *usb_receiver(void *targ) { UsbCommand cmdbuf; while(arg->run) { - if (ReceiveCommandP(&cmdbuf) > 0) { + if (ReceiveCommandPoll(&cmdbuf)) { int i; for (i=0; iusb_present == 1) { + rarg.run=1; + pthread_create(&reader_thread, NULL, &usb_receiver, &rarg); + } while(1) { - struct usb_receiver_arg rarg; - pthread_t reader_thread; - rarg.run=1; - if (arg->usb_present == 1) { - pthread_create(&reader_thread, NULL, &usb_receiver, &rarg); - } cmd = readline(PROXPROMPT); - rarg.run=0; - if (arg->usb_present == 1) { - pthread_join(reader_thread, NULL); - } - if (cmd) { if (cmd[0] != 0x00) { CommandReceived(cmd); @@ -72,6 +67,11 @@ static void *main_loop(void *targ) break; } } + + if (arg->usb_present == 1) { + rarg.run = 0; + pthread_join(reader_thread, NULL); + } ExitGraphics(); pthread_exit(NULL);