Set fp baudrate to 38400

This commit is contained in:
Petr Baudis 2011-09-20 20:49:32 +02:00
parent 4d99961eba
commit 9ad5213863

View file

@ -24,6 +24,7 @@
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
#include <SDL.h> #include <SDL.h>
#include <termios.h>
#include <unistd.h> #include <unistd.h>
#define min(x,y) ( (x)<(y) ? (x) : (y) ) #define min(x,y) ( (x)<(y) ? (x) : (y) )
@ -284,6 +285,13 @@ int main(int argc, char* argv[])
return 1; return 1;
} }
if (fp) {
struct termios t;
tcgetattr(fileno(fp), &t);
cfsetspeed(&t, B38400);
tcsetattr(fileno(fp), TCSADRAIN, &t);
}
sleep(2); sleep(2);
if (SDL_Init(SDL_INIT_VIDEO) < 0) return 1; if (SDL_Init(SDL_INIT_VIDEO) < 0) return 1;