From 00d94d410fdf427d969b57ae436849b135796dda Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Tue, 25 Jul 2023 10:33:24 -0500 Subject: [PATCH] Make windows termios.c a touch faster Improve debug in termios.c https://github.com/Hamlib/Hamlib/issues/1123 --- lib/termios.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/termios.c b/lib/termios.c index d61036623..2a4e64374 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -1,5 +1,6 @@ #include #include +#include "misc.h" #if defined(WIN32) && !defined(HAVE_TERMIOS_H) @@ -9,9 +10,11 @@ #ifdef DEBUG #define DEBUG_VERBOSE #define DEBUG_ERRORS -#define report(a) fprintf(stderr,a) -#define report_warning(a) fprintf(stderr,a) -#define report_error(a) fprintf(stderr,a) +static char message[256]; +static char datestr[64]; +#define report(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a) +#define report_warning(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a) +#define report_error(a) fprintf(stderr, "%s: %s", date_strget(datestr, sizeof(datestr), 0), a) #else #define report(a) do {} while (0) #define report_warning(a) do {} while (0) @@ -1627,7 +1630,7 @@ int win32_serial_read(int fd, void *vb, int size) do { ClearErrors(index, &stat); - hl_usleep(1000); + hl_usleep(100); } while (stat.cbInQue < index->ttyset->c_cc[VMIN] && c > clock());