From f9ff2a75c226f790b6e5b5ed827da6d7695f2e8f Mon Sep 17 00:00:00 2001 From: Winfried Ritsch Date: Thu, 27 Oct 2005 11:17:04 +0000 Subject: optional WINDOWS2000 Patch und comments svn path=/trunk/externals/iem/comport/; revision=3767 --- comport/comport.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'comport/comport.c') diff --git a/comport/comport.c b/comport/comport.c index 0f45d48..77c575b 100644 --- a/comport/comport.c +++ b/comport/comport.c @@ -325,7 +325,11 @@ static HANDLE open_serial(int com_nr, t_comport *x) 0, 0, OPEN_EXISTING, +#ifdef WIN2000 + 0, +#elif FILE_FLAG_OVERLAPPED, +#endif 0); if(fd == INVALID_HANDLE_VALUE) @@ -682,11 +686,13 @@ static void comport_tick(t_comport *x) err = 0; -// if (!SetCommMask(x->comhandle, EV_RXCHAR)) -// post(" Error setting communications event mask for serial device"); +/* + if (!SetCommMask(x->comhandle, EV_RXCHAR)) + post(" Error setting communications event mask for serial device"); -// for ( ; ; ) { -// if (WaitCommEvent(x->comhandle, &dwCommEvent,NULL)) { + for ( ; ; ) { + if (WaitCommEvent(x->comhandle, &dwCommEvent,NULL)) { +*/ do { if(ReadFile(x->comhandle, &chr, 1, &dwRead, NULL)) @@ -697,13 +703,15 @@ static void comport_tick(t_comport *x) break; } } while (dwRead); -// } -// else{ -// post("serial dev: Error in WaitCommEvent"); - // break; -// } - //} +/* + } + else{ + post("serial dev: Error in WaitCommEvent"); + break; + } + } } +*/ #else { fd_set com_rfds; @@ -787,7 +795,7 @@ static void *comport_new(t_floatarg comnr, t_floatarg fbaud) { x->x_clock = clock_new(x, (t_method)comport_tick); clock_delay(x->x_clock, x->x_deltime); - + return x; } -- cgit v1.2.1