flush serial port during init of led class
This commit is contained in:
parent
a751a991d2
commit
eb7fa7347a
2 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#ifndef __PHOTO_BOOTH_LED_H__
|
||||
#define __PHOTO_BOOTH_LED_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <glib.h>
|
||||
|
||||
#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);
|
||||
|
|
Loading…
Add table
Reference in a new issue