mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Set up the GreaseWeazle termios properly.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
|
||||
static const char* gw_error(int e)
|
||||
{
|
||||
@@ -128,6 +129,16 @@ public:
|
||||
if (_fd == -1)
|
||||
Error() << fmt::format("cannot open GreaseWeazel serial port: {}", strerror(errno));
|
||||
|
||||
struct termios t;
|
||||
tcgetattr(_fd, &t);
|
||||
t.c_iflag = 0;
|
||||
t.c_oflag = 0;
|
||||
t.c_cflag = CREAD;
|
||||
t.c_lflag = 0;
|
||||
t.c_cc[VMIN] = 1;
|
||||
cfsetspeed(&t, 9600);
|
||||
tcsetattr(_fd, TCSANOW, &t);
|
||||
|
||||
_version = getVersion();
|
||||
if ((_version != 22) && (_version != 24))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user