aboutsummaryrefslogtreecommitdiff
path: root/comport/comport.c
diff options
context:
space:
mode:
authorWinfried Ritsch <ritsch@users.sourceforge.net>2005-10-27 11:17:04 +0000
committerWinfried Ritsch <ritsch@users.sourceforge.net>2005-10-27 11:17:04 +0000
commitf9ff2a75c226f790b6e5b5ed827da6d7695f2e8f (patch)
tree897d327d2e8a6e9f328b93c4a21e1f1bd499dbf9 /comport/comport.c
parente301bd9261daed7622d6d288de0b64ae49163f13 (diff)
optional WINDOWS2000 Patch und comments
svn path=/trunk/externals/iem/comport/; revision=3767
Diffstat (limited to 'comport/comport.c')
-rw-r--r--comport/comport.c30
1 files changed, 19 insertions, 11 deletions
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;
}