diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | client/serial_linux.c | 4 | ||||
-rw-r--r-- | robot/sim.h | 19 |
3 files changed, 12 insertions, 12 deletions
@@ -9,3 +9,4 @@ client/main *.log scripts/InstallationLog.txt docs/ +robot/tty diff --git a/client/serial_linux.c b/client/serial_linux.c index ae8e646..080dca1 100644 --- a/client/serial_linux.c +++ b/client/serial_linux.c @@ -71,7 +71,7 @@ bool w2_serial_write(char *data, uint8_t length) { } bool w2_serial_open(const char *port_name) { - g_w2_serial_handle = open(port_name, O_RDWR | O_NOCTTY | O_NONBLOCK); + g_w2_serial_handle = open(port_name, O_RDWR | O_NONBLOCK); if (g_w2_serial_handle < 0 || tcgetattr(g_w2_serial_handle, &g_w2_tty) != 0) return false; g_w2_tty_old = g_w2_tty; @@ -80,8 +80,6 @@ bool w2_serial_open(const char *port_name) { cfsetospeed(&g_w2_tty, baud); cfsetispeed(&g_w2_tty, baud); - g_w2_tty.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS); - g_w2_tty.c_cflag |= CS8 | CREAD | CLOCAL; g_w2_tty.c_cc[VMIN] = 0; g_w2_tty.c_cc[VTIME] = 0; diff --git a/robot/sim.h b/robot/sim.h index 864a43a..5dbd936 100644 --- a/robot/sim.h +++ b/robot/sim.h @@ -24,15 +24,6 @@ extern bool g_w2_sim_headless; #define DBG_BYTES_PER_LINE 16 // debug colors -#define COL_BLK "" -#define COL_RED "" -#define COL_GRN "" -#define COL_YEL "" -#define COL_BLU "" -#define COL_MAG "" -#define COL_CYN "" -#define COL_WHT "" -#define COL_RST "" #ifdef DBG_ENABLE_COLOR #define COL_BLK "\e[0;30m" #define COL_RED "\e[0;31m" @@ -43,6 +34,16 @@ extern bool g_w2_sim_headless; #define COL_CYN "\e[0;36m" #define COL_WHT "\e[0;37m" #define COL_RST "\e[0m" +#else +#define COL_BLK "" +#define COL_RED "" +#define COL_GRN "" +#define COL_YEL "" +#define COL_BLU "" +#define COL_MAG "" +#define COL_CYN "" +#define COL_WHT "" +#define COL_RST "" #endif // debug stdout print macros |