Этот коммит содержится в:
phyto 2019-05-14 15:33:00 +02:00
родитель 970231b357
Коммит 33c96b1a63
3 изменённых файлов: 19 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,5 @@
# ---------------------------------------------------
# May be we have to put those objs in a .a ?
OPT = -Wall -DDEBUG_LEVEL=0
OBJS = serial.o funcs.o

Просмотреть файл

@ -122,13 +122,26 @@ byte = 0;
foo = read(fd, &byte, 1);
if (1 != foo)
{
fprintf(stderr, "byte %d rd %d errno %d\n",
byte, foo, errno);
fprintf(stderr, "%s : byte %d rd %d errno %d\n",
__func__, byte, foo, errno);
return -1;
}
return (int)byte;
}
/* -------------------------------------------------------------------- */
int putbyte(int fd, unsigned char byte)
{
int foo = -1;
foo = write(fd, &byte, 1);
if (1 != foo)
{
fprintf(stderr, "%s : %d -> %d errno %d\n",
__func__, byte, foo, errno);
}
return foo;
}
/* -------------------------------------------------------------------- */
/* timeout is in milliseconds */
int getbyte_to (int fd, int to_ms)

Просмотреть файл

@ -6,8 +6,8 @@
int prepare_UART(char *port, int bauds);
int getbyte(int fd); /* really brotched func */
int getbyte(int fd); /* really brotched func */
int putbyte(int fd, unsigned char byte);
/* timeout is exprimed in milliseconds. */
int getbyte_to (int fd, int to_ms);