|
|
|
@ -19,7 +19,7 @@
@@ -19,7 +19,7 @@
|
|
|
|
|
|
|
|
|
|
#include "UARTDriver.h" |
|
|
|
|
|
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
#include <termios.h> |
|
|
|
|
#else |
|
|
|
|
#include <asm/termbits.h> |
|
|
|
@ -35,7 +35,7 @@ bool HALSITL::UARTDriver::set_speed(int speed)
@@ -35,7 +35,7 @@ bool HALSITL::UARTDriver::set_speed(int speed)
|
|
|
|
|
if (_fd < 0) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
struct termios t; |
|
|
|
|
tcgetattr(_fd, &t); |
|
|
|
|
cfsetspeed(&t, speed); |
|
|
|
@ -68,7 +68,7 @@ void HALSITL::UARTDriver::configure_parity(uint8_t v)
@@ -68,7 +68,7 @@ void HALSITL::UARTDriver::configure_parity(uint8_t v)
|
|
|
|
|
if (_fd < 0) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
struct termios t; |
|
|
|
|
|
|
|
|
|
tcgetattr(_fd, &t); |
|
|
|
@ -93,7 +93,7 @@ void HALSITL::UARTDriver::configure_parity(uint8_t v)
@@ -93,7 +93,7 @@ void HALSITL::UARTDriver::configure_parity(uint8_t v)
|
|
|
|
|
t.c_cflag &= ~PARENB; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
tcsetattr(_fd, TCSANOW, &t); |
|
|
|
|
#else |
|
|
|
|
ioctl(_fd, TCSETS2, &t); |
|
|
|
@ -105,7 +105,7 @@ void HALSITL::UARTDriver::set_stop_bits(int n)
@@ -105,7 +105,7 @@ void HALSITL::UARTDriver::set_stop_bits(int n)
|
|
|
|
|
if (_fd < 0) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
struct termios t; |
|
|
|
|
|
|
|
|
|
tcgetattr(_fd, &t); |
|
|
|
@ -123,7 +123,7 @@ void HALSITL::UARTDriver::set_stop_bits(int n)
@@ -123,7 +123,7 @@ void HALSITL::UARTDriver::set_stop_bits(int n)
|
|
|
|
|
t.c_cflag &= ~CSTOPB; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef __CYGWIN__ |
|
|
|
|
#if defined(__CYGWIN__) || defined(__APPLE__) |
|
|
|
|
tcsetattr(_fd, TCSANOW, &t); |
|
|
|
|
#else |
|
|
|
|
ioctl(_fd, TCSETS2, &t); |
|
|
|
|