OpenCores
URL https://opencores.org/ocsvn/1664/1664/trunk

Subversion Repositories 1664

[/] [1664/] [trunk/] [c/] [linux/] [consola_leje_carater.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mrdmkg
#include "sospesifada.h"
2
#include <termios.h>
3
 
4
char consola_leje_carater()
5
{
6
 char carater = 0;
7
 struct termios old = {0};
8
 tcgetattr(0, &old);
9
 old.c_lflag &= ~ICANON;
10
 old.c_lflag &= ~ECHO;
11
 old.c_cc[VMIN] = 1;
12
 old.c_cc[VTIME] = 0;
13
 tcsetattr(0, TCSANOW, &old);
14
 read(0, &carater, 1);
15
 old.c_lflag |= ICANON;
16
 old.c_lflag |= ECHO;
17
 tcsetattr(0, TCSADRAIN, &old);
18
 return carater;
19
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.