From ef330e8501c067269dc3fb8945f1086aa9022f81 Mon Sep 17 00:00:00 2001 From: dadecoza Date: Sat, 7 Dec 2024 18:54:54 +0200 Subject: [PATCH] updated timeouts --- Makefile.mingw | 3 +-- meshtastic.c | 4 ++-- meshtastic.h | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile.mingw b/Makefile.mingw index b9b55a4..5e8e304 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -5,8 +5,7 @@ include ./nanopb/extra/nanopb.mk CC ?= gcc -C_FLAGS = -Wall -Werror -g -O2 - +C_FLAGS = -Wall -Werror -g -O2 -std=c99 # PIDGIN_TREE_TOP := ../pidgin-release-2.x.y diff --git a/meshtastic.c b/meshtastic.c index 84928ec..d220f3b 100644 --- a/meshtastic.c +++ b/meshtastic.c @@ -118,9 +118,9 @@ int mt_connect(MeshtasticAccount *mta, char *port, enum connection_type type) // Configure read and write operations to time out after 100 ms. COMMTIMEOUTS timeouts = {0}; timeouts.ReadIntervalTimeout = MAXDWORD; - timeouts.ReadTotalTimeoutConstant = 0; + timeouts.ReadTotalTimeoutConstant = 100; timeouts.ReadTotalTimeoutMultiplier = 0; - timeouts.WriteTotalTimeoutConstant = 10; + timeouts.WriteTotalTimeoutConstant = 100; timeouts.WriteTotalTimeoutMultiplier = 0; success = SetCommTimeouts(mta->handle, &timeouts); diff --git a/meshtastic.h b/meshtastic.h index 325d632..bc01a53 100644 --- a/meshtastic.h +++ b/meshtastic.h @@ -31,6 +31,10 @@ # define dngettext(Domain, Singular, Plural, Number) ((Number == 1) ? ((const char *)Singular) : ((const char *)Plural)) #endif +#ifndef M_PI + #define M_PI 3.14159265358979323846 +#endif + enum connection_type { meshtastic_serial_connection, meshtastic_socket_connection