diff --git a/src/RS232.h b/src/RS232.h --- a/src/RS232.h +++ b/src/RS232.h @@ -1,7 +1,7 @@ // SOPSUYSI_RS232.h #ifndef RS232_H #define RS232_H -#define debug +#define RS232_debug #define badPortValue -1 #define rs232noerr 0 diff --git a/src/RS232_unix.c b/src/RS232_unix.c --- a/src/RS232_unix.c +++ b/src/RS232_unix.c @@ -30,7 +30,7 @@ rs232port_t rs232open(char* psPortName) fd = (rs232port_t)open(psPortName, O_RDWR | O_NOCTTY );//| O_NDELAY); //fcntl((int)fd, F_SETFL, FNDELAY); //fd = open(psPortName, O_RDWR | O_NOCTTY); - #ifdef debug + #ifdef RS232_debug if(fd==-1)printf("can't open Port\n"); #else if(fd!=-1) @@ -149,7 +149,7 @@ int rs232setup(rs232port_t fd, int ChSiz terminos.c_cc[VMIN]=0; terminos.c_cc[VTIME]=1; tcflush(fd, TCIFLUSH); - #ifdef debug + #ifdef RS232_debug if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n"); #else tcsetattr(fd, TCSANOW, &terminos); diff --git a/src/RS232_win.c b/src/RS232_win.c --- a/src/RS232_win.c +++ b/src/RS232_win.c @@ -101,7 +101,7 @@ rs232port_t rs232open(char* psPortName) { rs232port_t fd; fd = (rs232port_t)CreateFile(psPortName,GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); - #ifdef debug + #ifdef RS232_debug if(fd==(rs232port_t)INVALID_HANDLE_VALUE) { printf("can't open Port\n");