25 #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO || \ 26 CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BLUE 37 using namespace Linux;
43 struct termios options;
45 tcgetattr(
fd, &options);
47 cfsetispeed(&options, B115200);
48 cfsetospeed(&options, B115200);
50 options.c_cflag &= ~(PARENB|CSTOPB|CSIZE);
51 options.c_cflag |= CS8;
53 options.c_lflag &= ~(ICANON|ECHO|ECHOE|ISIG);
54 options.c_iflag &= ~(IXON|IXOFF|IXANY);
55 options.c_oflag &= ~OPOST;
57 if (tcsetattr(
fd, TCSANOW, &options) != 0) {
62 tcflush(
fd, TCIOFLUSH);
91 if (select(
fd+1, &fds,
nullptr,
nullptr, &tv) != 1) {
98 nread =
::read(
fd, bytes,
sizeof(bytes));
99 }
while (nread ==
sizeof(bytes));
104 bool got_frame =
false;
163 #endif // CONFIG_HAL_BOARD_SUBTYPE
int open(const char *pathname, int flags)
POSIX Open a file with integer mode flags.
char * strerror(int errnum)
POSIX strerror() - convert POSIX errno to text with user message.
int errno
Note: fdevopen assigns stdin,stdout,stderr.
void panic(const char *errormsg,...) FMT_PRINTF(1