Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/rs232.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "rs232.h"


#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
#ifndef _WIN32 /* Linux, FreeBSD, macOS */

#define RS232_PORTNR 38

Expand Down Expand Up @@ -103,6 +103,7 @@ int RS232_OpenComport(int comport_number, int baudrate, const char *mode)
break;
case 230400 : baudr = B230400;
break;
#ifndef __APPLE__
case 460800 : baudr = B460800;
break;
case 500000 : baudr = B500000;
Expand All @@ -127,6 +128,7 @@ int RS232_OpenComport(int comport_number, int baudrate, const char *mode)
break;
case 4000000 : baudr = B4000000;
break;
#endif /* __APPLE__ */
default : printf("invalid baudrate\n");
return(1);
break;
Expand Down Expand Up @@ -480,7 +482,7 @@ void RS232_flushRXTX(int comport_number)
}


#else /* windows */
#else /* _WIN32 */

#define RS232_PORTNR 16

Expand Down
10 changes: 3 additions & 7 deletions src/rs232.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ extern "C" {



#if defined(__linux__) || defined(__FreeBSD__)

#if _WIN32
#include <windows.h>
#else /* _WIN32 */
#include <termios.h>
#include <sys/ioctl.h>
#include <unistd.h>
Expand All @@ -53,11 +54,6 @@ extern "C" {
#include <limits.h>
#include <sys/file.h>
#include <errno.h>

#else

#include <windows.h>

#endif

int RS232_OpenComport(int, int, const char *);
Expand Down