X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/940a20122dccd83c3f409eec1321c88b5f7058f7..022c8791c14841d9c32f19b8b06ef6651bdcbd15:/client/proxmark3.c diff --git a/client/proxmark3.c b/client/proxmark3.c index 280d07f9..05c2fe2d 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -45,21 +45,17 @@ static void *main_loop(void *targ) { struct main_loop_arg *arg = (struct main_loop_arg*)targ; char *cmd = NULL; + pthread_t reader_thread; - while(1) { + if (arg->usb_present == 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); - } + pthread_create(&reader_thread, NULL, &usb_receiver, &rarg); + } + + while(1) { + cmd = readline(PROXPROMPT); if (cmd) { if (cmd[0] != 0x00) { CommandReceived(cmd);