aller chercher des bieres ?

This commit is contained in:
phyto 2019-05-18 18:01:05 +02:00
parent 40e1d434ff
commit 6ad5283de9
4 changed files with 12 additions and 8 deletions

View File

@ -5,7 +5,7 @@
CC = gcc CC = gcc
CCOPT = -Wall -g CCOPT = -Wall -g
CLIB = core/libdd2m-core.a viz/libdd2m-viz.a CLIB = core/libdd2m-core.a viz/libdd2m-viz.a
OBJS = essai.o terminal.o
all: essai all: essai
# ------------------------------------------------------- # -------------------------------------------------------
@ -15,8 +15,7 @@ OSERIAL = serial/serial.o serial/funcs.o
essai.o: essai.c Makefile essai.o: essai.c Makefile
$(CC) ${CCOPT} $< -c $(CC) ${CCOPT} $< -c
essai: ${OBJS} Makefile $(CLIB) ${OSERIAL}
essai: essai.o Makefile $(CLIB) ${OSERIAL}
$(CC) ${CCOPT} $< $(CLIB) ${OSERIAL} -lncurses -o $@ $(CC) ${CCOPT} $< $(CLIB) ${OSERIAL} -lncurses -o $@
fake-values: fake-values.c Makefile $(CLIB) fake-values: fake-values.c Makefile $(CLIB)

View File

@ -1,8 +1,8 @@
# --------------------------------------------------- # ---------------------------------------------------
# May be we have to put those objs in a .a ? # May be we have to put those objs in a .a ?
OPT = -Wall -DDEBUG_LEVEL=0 OPT = -Wall -DDEBUG_LEVEL=1
OBJS = serial.o funcs.o OBJS = serial.o funcs.o
# --------------------------------------------------- # ---------------------------------------------------
serial.o: serial.c serial.h Makefile serial.o: serial.c serial.h Makefile
@ -14,5 +14,6 @@ funcs.o: funcs.c serial.h Makefile
# --------------------------------------------------- # ---------------------------------------------------
t: t.c Makefile ${OBJS} t: t.c Makefile ${OBJS}
gcc ${OPT} $< ${OBJS} -o $@ gcc ${OPT} $< ${OBJS} -lncurses -o $@
# ---------------------------------------------------

View File

@ -9,11 +9,15 @@ 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); int putbyte(int fd, unsigned char byte);
/* timeout is exprimed in milliseconds. */ /* timeout is exprimed in milliseconds. */
int getbyte_to (int fd, int to_ms); int getbyte_to (int fd, int to_ms);
int getline_to(int fd, char *where, int szm, int to_ms); int getline_to(int fd, char *where, int szm, int to_ms);
/* auxiliary and test functions */ /* auxiliary and test functions */
int parseXvalue(char *asciidatas, char id); int parseXvalue(char *asciidatas, char id);

View File

@ -162,10 +162,10 @@ switch (param) {
retv = loop(serial_in, nbre); retv = loop(serial_in, nbre);
break; break;
case 1: case 1:
retv = essai_terminal(serial_in, device, 0); retv = -1;
break; break;
default: default:
retv = -1; retv = -2;
break; break;
} }