// Code for communicating with the proxmark3 hardware.
//-----------------------------------------------------------------------------
+#define _POSIX_C_SOURCE 199309L // need clock_gettime()
+
#include "comms.h"
#include <stdio.h>
#include <pthread.h>
#include <inttypes.h>
#include <time.h>
+#include <sys/time.h>
#include "uart.h"
#include "ui.h"
#endif
uint64_t start_time = msclock();
- uint64_t end_time = start_time + ms_timeout;
if (response == NULL) {
response = &resp;
// Wait until the command is received
while (true) {
- if (msclock() > end_time) {
+ if (ms_timeout != -1 && msclock() > start_time + ms_timeout) {
break; // timeout
}
if (msclock() - start_time > 2000 && show_warning) {