From 89f76f91fdaf30ed691a8e8a46e60d8de2fd4f9c Mon Sep 17 00:00:00 2001 From: PaulStoffregen Date: Fri, 1 Apr 2016 01:08:40 -0700 Subject: [PATCH] Make sure DTR asserted on Windows --- Makefile | 4 +++- serialdata.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4022d35..f4ae490 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ CXXFLAGS = $(CFLAGS) `$(WXCONFIG) --cppflags` WXCONFIG = ~/wxwidgets/3.0.2.mac-opengl/bin/wx-config SFLAG = -s CLILIBS = -lglut -lGLU -lGL -lm +VERSION = 0.01 else ifeq ($(OS), MACOSX_CLANG) ALL = gui.app @@ -34,6 +35,7 @@ WXCONFIG = wx-config CXXFLAGS = $(CFLAGS) `$(WXCONFIG) --cppflags` SFLAG = CLILIBS = -lglut -lGLU -lGL -lm +VERSION = 0.01 else ifeq ($(OS), WINDOWS) ALL = gui.exe @@ -45,7 +47,7 @@ LDFLAGS = -static -static-libgcc SFLAG = -s WXCONFIG = ~/wxwidgets/3.0.2.mingw-opengl/bin/wx-config CLILIBS = -lglut32 -lglu32 -lopengl32 -lm -VERSION = 0.01 +MAKEFLAGS = --jobs=12 endif diff --git a/serialdata.c b/serialdata.c index c1a5645..faeb071 100644 --- a/serialdata.c +++ b/serialdata.c @@ -527,6 +527,10 @@ int open_port(const char *name) CloseHandle(port_handle); return 0; } + if (!EscapeCommFunction(port_handle, SETDTR)) { + CloseHandle(port_handle); + return 0; + } return 1; }