chg: cleanup from offical repo

This commit is contained in:
iceman1001 2018-04-18 20:17:00 +02:00
parent 646ff0ce68
commit 2e6699273e
6 changed files with 5 additions and 16 deletions

View file

@ -30,8 +30,6 @@
#include "cmdcrc.h"
#include "cmdanalyse.h"
unsigned int current_command = CMD_UNKNOWN;
static int CmdHelp(const char *Cmd);
static int CmdQuit(const char *Cmd);
static int CmdRev(const char *Cmd);
@ -140,7 +138,7 @@ int getCommand(UsbCommand* response) {
* Waits for a certain response type. This method waits for a maximum of
* ms_timeout milliseconds for a specified response command.
*@brief WaitForResponseTimeout
* @param cmd command to wait for
* @param cmd command to wait for, or CMD_UNKNOWN to take any command.
* @param response struct to copy received command into.
* @param ms_timeout
* @return true if command was returned, otherwise false
@ -158,7 +156,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
while (true) {
while ( getCommand(response) ) {
if (response->cmd == cmd)
if (cmd == CMD_UNKNOWN || response->cmd == cmd)
return true;
}
@ -166,6 +164,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, UsbCommand* response, size_t ms_timeo
break;
if (msclock() - start_time > 3000 && show_warning) {
// 3 seconds elapsed (but this doesn't mean the timeout was exceeded)
PrintAndLogEx(NORMAL, "Waiting for a response from the proxmark...");
PrintAndLogEx(NORMAL, "You can cancel this operation by pressing the pm3 button");
show_warning = false;

View file

@ -15,9 +15,6 @@ void ReceiveCommand(UsbCommand* rxcmd);
void CloseProxmark();
int OpenProxmark();
// FIXME: what the fuckity fuck
unsigned int current_command = CMD_UNKNOWN;
#define FLASH_START 0x100000
#ifdef HAS_512_FLASH

View file

@ -17,9 +17,6 @@
#include "elf.h"
#include "proxendian.h"
// FIXME: what the fuckity fuck
unsigned int current_command = CMD_UNKNOWN;
#define FLASH_START 0x100000
#define FLASH_SIZE (256*1024)
#define FLASH_END (FLASH_START + FLASH_SIZE)

View file

@ -19,7 +19,6 @@ usb_dev_handle *devh = NULL;
static unsigned int claimed_iface = 0;
unsigned char return_on_error = 0;
unsigned char error_occured = 0;
extern unsigned int current_command;
void SendCommand(UsbCommand *c)
{
@ -28,7 +27,7 @@ void SendCommand(UsbCommand *c)
#if 0
printf("Sending %d bytes\n", sizeof(UsbCommand));
#endif
current_command = c->cmd;
ret = usb_bulk_write(devh, 0x01, (char*)c, sizeof(UsbCommand), 1000);
if (ret<0) {
error_occured = 1;

View file

@ -29,7 +29,7 @@ GZIP=gzip
OBJDIR = obj
INCLUDE = -I../include -I../common
INCLUDE = -I../include -I../common -I.
TAR=tar
TARFLAGS = -C .. -rvf

View file

@ -11,7 +11,6 @@
#include "crc16.h"
// REQUEST FLAGS
#define ISO15_REQ_SUBCARRIER_SINGLE 0x00 // Tag should respond using one subcarrier (ASK)
#define ISO15_REQ_SUBCARRIER_TWO 0x01 // Tag should respond using two subcarriers (FSK)
#define ISO15_REQ_DATARATE_LOW 0x00 // Tag should respond using low data rate
@ -22,13 +21,11 @@
#define ISO15_REQ_PROTOCOL_EXT 0x08 // RFU
// REQUEST FLAGS when INVENTORY is not set
#define ISO15_REQ_SELECT 0x10 // only selected cards response
#define ISO15_REQ_ADDRESS 0x20 // this req contains an address
#define ISO15_REQ_OPTION 0x40 // Command specific option selector
//REQUEST FLAGS when INVENTORY is set
#define ISO15_REQINV_AFI 0x10 // AFI Field is present
#define ISO15_REQINV_SLOT1 0x20 // 1 Slot
#define ISO15_REQINV_SLOT16 0x00 // 16 Slots