@@ -1,7 +1,7 | |||
|
1 | 1 | // SOPSUYSI_RS232.h |
|
2 | 2 | #ifndef RS232_H |
|
3 | 3 | #define RS232_H |
|
4 | #define debug | |
|
4 | #define RS232_debug | |
|
5 | 5 | |
|
6 | 6 | #define badPortValue -1 |
|
7 | 7 | #define rs232noerr 0 |
@@ -30,7 +30,7 rs232port_t rs232open(char* psPortName) | |||
|
30 | 30 | fd = (rs232port_t)open(psPortName, O_RDWR | O_NOCTTY );//| O_NDELAY); |
|
31 | 31 | //fcntl((int)fd, F_SETFL, FNDELAY); |
|
32 | 32 | //fd = open(psPortName, O_RDWR | O_NOCTTY); |
|
33 | #ifdef debug | |
|
33 | #ifdef RS232_debug | |
|
34 | 34 | if(fd==-1)printf("can't open Port\n"); |
|
35 | 35 | #else |
|
36 | 36 | if(fd!=-1) |
@@ -149,7 +149,7 int rs232setup(rs232port_t fd, int ChSiz | |||
|
149 | 149 | terminos.c_cc[VMIN]=0; |
|
150 | 150 | terminos.c_cc[VTIME]=1; |
|
151 | 151 | tcflush(fd, TCIFLUSH); |
|
152 | #ifdef debug | |
|
152 | #ifdef RS232_debug | |
|
153 | 153 | if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n"); |
|
154 | 154 | #else |
|
155 | 155 | tcsetattr(fd, TCSANOW, &terminos); |
@@ -101,7 +101,7 rs232port_t rs232open(char* psPortName) | |||
|
101 | 101 | { |
|
102 | 102 | rs232port_t fd; |
|
103 | 103 | fd = (rs232port_t)CreateFile(psPortName,GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); |
|
104 | #ifdef debug | |
|
104 | #ifdef RS232_debug | |
|
105 | 105 | if(fd==(rs232port_t)INVALID_HANDLE_VALUE) |
|
106 | 106 | { |
|
107 | 107 | printf("can't open Port\n"); |
General Comments 0
You need to be logged in to leave comments.
Login now