diff --git a/Makefile b/Makefile index f0cfa71..9020163 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CC = gcc CCOPT = -Wall -g CLIB = core/libdd2m-core.a viz/libdd2m-viz.a - +OBJS = essai.o terminal.o all: essai # ------------------------------------------------------- @@ -15,8 +15,7 @@ OSERIAL = serial/serial.o serial/funcs.o essai.o: essai.c Makefile $(CC) ${CCOPT} $< -c - -essai: essai.o Makefile $(CLIB) ${OSERIAL} +essai: ${OBJS} Makefile $(CLIB) ${OSERIAL} $(CC) ${CCOPT} $< $(CLIB) ${OSERIAL} -lncurses -o $@ fake-values: fake-values.c Makefile $(CLIB) diff --git a/serial/Makefile b/serial/Makefile index c8fb1c1..b9f7c5c 100644 --- a/serial/Makefile +++ b/serial/Makefile @@ -1,8 +1,8 @@ # --------------------------------------------------- # May be we have to put those objs in a .a ? -OPT = -Wall -DDEBUG_LEVEL=0 -OBJS = serial.o funcs.o +OPT = -Wall -DDEBUG_LEVEL=1 +OBJS = serial.o funcs.o # --------------------------------------------------- serial.o: serial.c serial.h Makefile @@ -14,5 +14,6 @@ funcs.o: funcs.c serial.h Makefile # --------------------------------------------------- t: t.c Makefile ${OBJS} - gcc ${OPT} $< ${OBJS} -o $@ + gcc ${OPT} $< ${OBJS} -lncurses -o $@ +# --------------------------------------------------- diff --git a/serial/serial.h b/serial/serial.h index ba934c7..78e13ad 100644 --- a/serial/serial.h +++ b/serial/serial.h @@ -9,11 +9,15 @@ int prepare_UART(char *port, int bauds); 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); int getline_to(int fd, char *where, int szm, int to_ms); + + /* auxiliary and test functions */ int parseXvalue(char *asciidatas, char id); diff --git a/serial/t.c b/serial/t.c index ade83a6..537837c 100644 --- a/serial/t.c +++ b/serial/t.c @@ -162,10 +162,10 @@ switch (param) { retv = loop(serial_in, nbre); break; case 1: - retv = essai_terminal(serial_in, device, 0); + retv = -1; break; default: - retv = -1; + retv = -2; break; }