From eb7fa7347a4e06425e576b4d60a8c7cc034f45ec Mon Sep 17 00:00:00 2001 From: Andreas Frisch Date: Thu, 2 Jun 2016 17:00:13 +0200 Subject: [PATCH] flush serial port during init of led class --- photoboothled.c | 1 + photoboothled.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/photoboothled.c b/photoboothled.c index 24ca052..15e9a7e 100644 --- a/photoboothled.c +++ b/photoboothled.c @@ -79,6 +79,7 @@ static void photo_booth_led_init (PhotoBoothLed *led) tty.c_lflag |= ICANON; tty.c_oflag &= ~OPOST; tcsetattr(led->fd, TCSANOW, &tty); + tcsetattr(led->fd, TCSAFLUSH, &tty); char tempbuf[32]; int n = read (led->fd, tempbuf, sizeof(tempbuf)-1); GST_WARNING_OBJECT(led, "read %i bytes: '%s'", n, tempbuf); diff --git a/photoboothled.h b/photoboothled.h index 93df161..6c6b5fa 100644 --- a/photoboothled.h +++ b/photoboothled.h @@ -16,6 +16,7 @@ #ifndef __PHOTO_BOOTH_LED_H__ #define __PHOTO_BOOTH_LED_H__ +#include #include #define LED_BLACK 'b' @@ -42,7 +43,7 @@ struct _PhotoBoothLed struct _PhotoBoothLedClass { - GtkApplicationClass parent_class; + GObjectClass parent_class; }; GType photo_booth_led_get_type (void);