X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/f7e3ed82874bfd8951c90536bd7185d599d6dbf8..4cd41f34ead6351f3b0a897453b25c036021c53f:/client/flash.c diff --git a/client/flash.c b/client/flash.c index b4e4c891..68d3b097 100644 --- a/client/flash.c +++ b/client/flash.c @@ -1,14 +1,8 @@ -#ifdef WIN32 -#include -#include -#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) -BOOL UsbConnect(void); -#endif -#include - #include #include #include +#include "sleep.h" +#include "proxusb.h" #include "flash.h" #include "elf.h" @@ -194,7 +188,7 @@ unsigned int EnterFlashState(void) if (state & DEVICE_INFO_FLAG_CURRENT_MODE_OS) { fprintf(stderr,"Entering flash-mode...\n"); UsbCommand c; - bzero(&c, sizeof(c)); + memset(&c, 0, sizeof (c)); if ((state & DEVICE_INFO_FLAG_BOOTROM_PRESENT) && (state & DEVICE_INFO_FLAG_OSIMAGE_PRESENT)) { /* New style handover: Send CMD_START_FLASH, which will reset the board and @@ -212,15 +206,10 @@ unsigned int EnterFlashState(void) fprintf(stderr,"Waiting for Proxmark to reappear on USB... "); } -#ifdef WIN32 - Sleep(1000); - while (!UsbConnect()) { Sleep(1000); } -#else CloseProxmark(); sleep(1); while (!OpenProxmark(0)) { sleep(1); } -#endif fprintf(stderr,"Found.\n"); return GetProxmarkState();