From bcce32e16d7db064c44e609c0badcdb0ba68dd4f Mon Sep 17 00:00:00 2001 From: brian crabtree Date: Thu, 23 Dec 2021 09:54:56 -0500 Subject: [PATCH 1/2] change blocking/timing --- src/platform/posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/posix.c b/src/platform/posix.c index d610bef..0adde4a 100644 --- a/src/platform/posix.c +++ b/src/platform/posix.c @@ -99,7 +99,7 @@ int monome_platform_open(monome_t *monome, const monome_devmap_t *m, struct termios nt, ot; int fd; - if( (fd = open(dev, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0 ) { + if( (fd = open(dev, O_RDWR | O_NOCTTY)) < 0 ) { perror("libmonome: could not open monome device"); return 1; } @@ -131,8 +131,8 @@ int monome_platform_open(monome_t *monome, const monome_devmap_t *m, nt.c_oflag &= ~(OCRNL | ONLCR | ONLRET | ONOCR | OFILL | OPOST); - nt.c_cc[VMIN] = 1; - nt.c_cc[VTIME] = 0; + nt.c_cc[VMIN] = 0; + nt.c_cc[VTIME] = 1; if( tcsetattr(fd, TCSANOW, &nt) < 0 ) goto err_tcsetattr; From c12dd03b9f690fc0eda19043e4f80efd310a9fc9 Mon Sep 17 00:00:00 2001 From: brian crabtree Date: Thu, 23 Dec 2021 13:01:59 -0500 Subject: [PATCH 2/2] vtime = 0 --- examples/torture.c | 6 +++--- src/platform/posix.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/torture.c b/examples/torture.c index 59e67ba..42ebeea 100644 --- a/examples/torture.c +++ b/examples/torture.c @@ -28,10 +28,10 @@ #include #define MONOME_OSC "osc.udp://127.0.0.1:8080/monome" -#define MONOME_SERIAL "/dev/ttyUSB0" +#define MONOME_SERIAL "/dev/ttyACM0" #define WIDTH 16 -#define HEIGHT 16 +#define HEIGHT 8 void random_chill() { struct timespec rem, req; @@ -47,7 +47,7 @@ int main(int argc, char **argv) { unsigned int w, h, y, s; uint16_t buf; - if( !(monome = monome_open(MONOME_OSC, "8000")) ) { + if( !(monome = monome_open(MONOME_SERIAL, "8000")) ) { fprintf(stderr, "couldn't open monome\n"); exit(EXIT_FAILURE); } diff --git a/src/platform/posix.c b/src/platform/posix.c index 0adde4a..f1ba899 100644 --- a/src/platform/posix.c +++ b/src/platform/posix.c @@ -132,7 +132,7 @@ int monome_platform_open(monome_t *monome, const monome_devmap_t *m, OFILL | OPOST); nt.c_cc[VMIN] = 0; - nt.c_cc[VTIME] = 1; + nt.c_cc[VTIME] = 0; if( tcsetattr(fd, TCSANOW, &nt) < 0 ) goto err_tcsetattr;