Преглед на файлове

tools: improve reliability of ttyopen()

Previously, communications with my RC2014 would always be rocky and
fail most of the time. By sending an CR at init, things go much
smoother.
master
Virgil Dupras преди 3 години
родител
ревизия
a19c814b0d
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  1. +5
    -0
      tools/common.c

+ 5
- 0
tools/common.c Целия файл

@@ -149,6 +149,11 @@ int ttyopen(char *devname)
set_interface_attribs(fd, 0, 0);
set_blocking(fd, 0);
mempty(fd);
// Communication with device is much more reliable if we
// begin by sending, asynchronously, a CR to make sure we
// empty any pending stuff on all sides.
write(fd, "\r", 1);
mempty(fd);
set_blocking(fd, 1);
return fd;
}

Loading…
Отказ
Запис