Skip to content

Commit

Permalink
Merge pull request #72 from monome/blocking
Browse files Browse the repository at this point in the history
change blocking/timing
  • Loading branch information
tehn authored Dec 24, 2021
2 parents cd11b2f + c12dd03 commit 19da968
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/torture.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#include <monome.h>

#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;
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/platform/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -131,7 +131,7 @@ 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[VMIN] = 0;
nt.c_cc[VTIME] = 0;

if( tcsetattr(fd, TCSANOW, &nt) < 0 )
Expand Down

0 comments on commit 19da968

Please sign in to comment.