Skip to content

Commit

Permalink
TEST: syslink: add fsync after writing, change UART config
Browse files Browse the repository at this point in the history
  • Loading branch information
bkueng committed Mar 9, 2018
1 parent 47b34f9 commit b8ba1b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/syslink/syslink_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,13 @@ Syslink::open_serial(const char *dev)
tcgetattr(fd, &config);

// clear ONLCR flag (which appends a CR for every LF)
config.c_oflag &= ~ONLCR;
config.c_oflag = 0;

config.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);

// Disable hardware flow control
config.c_cflag &= ~CRTSCTS;
//config.c_cflag &= ~(CSTOPB | PARENB | CRTSCTS);


/* Set baud rate */
Expand Down Expand Up @@ -712,6 +715,7 @@ Syslink::send_bytes(const void *data, size_t len)
while (px4_arch_gpioread(GPIO_NRF_TXEN)) ;

write(_fd, ((const char *)data) + i, 1);
fsync(_fd);
}

return 0;
Expand Down

0 comments on commit b8ba1b7

Please sign in to comment.