Skip to content

Commit 00d94d4

Browse files
committed
Make windows termios.c a touch faster
Improve debug in termios.c Hamlib#1123
1 parent 8028928 commit 00d94d4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/termios.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <hamlib/rig.h>
22
#include <hamlib/config.h>
3+
#include "misc.h"
34

45
#if defined(WIN32) && !defined(HAVE_TERMIOS_H)
56

@@ -9,9 +10,11 @@
910
#ifdef DEBUG
1011
#define DEBUG_VERBOSE
1112
#define DEBUG_ERRORS
12-
#define report(a) fprintf(stderr,a)
13-
#define report_warning(a) fprintf(stderr,a)
14-
#define report_error(a) fprintf(stderr,a)
13+
static char message[256];
14+
static char datestr[64];
15+
#define report(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a)
16+
#define report_warning(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a)
17+
#define report_error(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a)
1518
#else
1619
#define report(a) do {} while (0)
1720
#define report_warning(a) do {} while (0)
@@ -1627,7 +1630,7 @@ int win32_serial_read(int fd, void *vb, int size)
16271630
do
16281631
{
16291632
ClearErrors(index, &stat);
1630-
hl_usleep(1000);
1633+
hl_usleep(100);
16311634
}
16321635
while (stat.cbInQue < index->ttyset->c_cc[VMIN] && c > clock());
16331636

0 commit comments

Comments
 (0)