This commit is contained in:
Philippe Teuwen 2019-05-05 22:04:35 +02:00
commit 65bd945b54
4 changed files with 13 additions and 13 deletions

View file

@ -91,7 +91,7 @@ int CmdHFTune(const char *Cmd) {
PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF measure, aborting"); PrintAndLogEx(WARNING, "Timeout while waiting for Proxmark HF measure, aborting");
return PM3_ETIMEOUT; return PM3_ETIMEOUT;
} }
if (resp.status!=PM3_EOPABORTED) if (resp.status != PM3_EOPABORTED)
return resp.status; return resp.status;
return PM3_SUCCESS; return PM3_SUCCESS;
} }

View file

@ -353,7 +353,7 @@ __attribute__((force_align_arg_pointer))
rxlen = 0; rxlen = 0;
bool ACK_received = false; bool ACK_received = false;
bool error = false; bool error = false;
pthread_mutex_lock(&spMutex); pthread_mutex_lock(&spMutex);
if (uart_receive(sp, (uint8_t *)&rx_raw.pre, sizeof(PacketResponseNGPreamble), &rxlen) && (rxlen == sizeof(PacketResponseNGPreamble))) { if (uart_receive(sp, (uint8_t *)&rx_raw.pre, sizeof(PacketResponseNGPreamble), &rxlen) && (rxlen == sizeof(PacketResponseNGPreamble))) {
@ -463,9 +463,9 @@ __attribute__((force_align_arg_pointer))
error = true; error = true;
} }
} }
pthread_mutex_unlock(&spMutex); pthread_mutex_unlock(&spMutex);
// TODO if error, shall we resync ? // TODO if error, shall we resync ?
pthread_mutex_lock(&txBufferMutex); pthread_mutex_lock(&txBufferMutex);
@ -484,7 +484,7 @@ __attribute__((force_align_arg_pointer))
} }
if (txBuffer_pending) { if (txBuffer_pending) {
pthread_mutex_lock(&spMutex); pthread_mutex_lock(&spMutex);
if (txBufferNGLen) { // NG packet if (txBufferNGLen) { // NG packet
if (!uart_send(sp, (uint8_t *) &txBufferNG, txBufferNGLen)) { if (!uart_send(sp, (uint8_t *) &txBufferNG, txBufferNGLen)) {
@ -499,7 +499,7 @@ __attribute__((force_align_arg_pointer))
} }
} }
pthread_mutex_unlock(&spMutex); pthread_mutex_unlock(&spMutex);
txBuffer_pending = false; txBuffer_pending = false;
// tell main thread that txBuffer is empty // tell main thread that txBuffer is empty
@ -603,17 +603,17 @@ int TestProxmark(void) {
if (conn.send_via_fpc_usart) { if (conn.send_via_fpc_usart) {
PrintAndLogEx(INFO, "UART Serial baudrate: " _YELLOW_("%u") "\n", conn.uart_speed); PrintAndLogEx(INFO, "UART Serial baudrate: " _YELLOW_("%u") "\n", conn.uart_speed);
} }
// reconfigure. // reconfigure.
if (conn.send_via_fpc_usart == false) { if (conn.send_via_fpc_usart == false) {
#if defined(_WIN32) #if defined(_WIN32)
pthread_mutex_lock(&spMutex); pthread_mutex_lock(&spMutex);
#endif #endif
int res = uart_reconfigure_timeouts(sp, UART_USB_CLIENT_RX_TIMEOUT_MS); int res = uart_reconfigure_timeouts(sp, UART_USB_CLIENT_RX_TIMEOUT_MS);
#if defined(_WIN32) #if defined(_WIN32)
pthread_mutex_unlock(&spMutex); pthread_mutex_unlock(&spMutex);
#endif #endif
if ( res != PM3_SUCCESS ) { if (res != PM3_SUCCESS) {
PrintAndLogEx(ERR, "UART reconfigure failed"); PrintAndLogEx(ERR, "UART reconfigure failed");
return res; return res;
} }
@ -696,7 +696,7 @@ bool WaitForResponseTimeoutW(uint32_t cmd, PacketResponseNG *response, size_t ms
__atomic_store_n(&timeout_start_time, msclock(), __ATOMIC_SEQ_CST); __atomic_store_n(&timeout_start_time, msclock(), __ATOMIC_SEQ_CST);
uint64_t tmp_clk; uint64_t tmp_clk;
// Wait until the command is received // Wait until the command is received
while (true) { while (true) {
@ -780,7 +780,7 @@ static bool dl_it(uint8_t *dest, uint32_t bytes, uint32_t start_index, PacketRes
uint32_t bytes_completed = 0; uint32_t bytes_completed = 0;
__atomic_store_n(&timeout_start_time, msclock(), __ATOMIC_SEQ_CST); __atomic_store_n(&timeout_start_time, msclock(), __ATOMIC_SEQ_CST);
uint64_t tmp_clk; uint64_t tmp_clk;
// Add delay depending on the communication channel & speed // Add delay depending on the communication channel & speed
if (ms_timeout != (size_t) -1) if (ms_timeout != (size_t) -1)
ms_timeout += communication_delay(); ms_timeout += communication_delay();

View file

@ -496,7 +496,7 @@ int main(int argc, char *argv[]) {
CloseProxmark(); CloseProxmark();
session.pm3_present = false; session.pm3_present = false;
} }
if (!session.pm3_present) if (!session.pm3_present)
PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check \"%s -h\" if it's not what you want.\n", exec_name); PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Check \"%s -h\" if it's not what you want.\n", exec_name);

View file

@ -84,7 +84,7 @@ void PrintAndLogEx(logLevel_t level, const char *fmt, ...) {
case WARNING: case WARNING:
strncpy(prefix, _CYAN_("[!]"), sizeof(prefix) - 1); strncpy(prefix, _CYAN_("[!]"), sizeof(prefix) - 1);
break; break;
case INFO: case INFO:
strncpy(prefix, _YELLOW_("[=]"), sizeof(prefix) - 1); strncpy(prefix, _YELLOW_("[=]"), sizeof(prefix) - 1);
break; break;
case NORMAL: case NORMAL: