Browse Source

aller chercher des bieres ?

phyto 6 months ago
parent
commit
6ad5283de9
4 changed files with 12 additions and 8 deletions
  1. 2
    3
      Makefile
  2. 4
    3
      serial/Makefile
  3. 4
    0
      serial/serial.h
  4. 2
    2
      serial/t.c

+ 2
- 3
Makefile View File

@@ -5,7 +5,7 @@
5 5
 CC	= gcc
6 6
 CCOPT	= -Wall -g 
7 7
 CLIB	= core/libdd2m-core.a viz/libdd2m-viz.a
8
-
8
+OBJS	= essai.o terminal.o
9 9
 all:	essai 
10 10
 
11 11
 # -------------------------------------------------------
@@ -15,8 +15,7 @@ OSERIAL	= serial/serial.o serial/funcs.o
15 15
 essai.o:	essai.c  Makefile 
16 16
 	$(CC) ${CCOPT} $< -c 
17 17
 
18
-
19
-essai:	essai.o  Makefile $(CLIB) ${OSERIAL}
18
+essai:	${OBJS} Makefile $(CLIB) ${OSERIAL}
20 19
 	$(CC) ${CCOPT} $< $(CLIB) ${OSERIAL} -lncurses -o $@
21 20
 
22 21
 fake-values:	fake-values.c  Makefile $(CLIB)

+ 4
- 3
serial/Makefile View File

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

+ 4
- 0
serial/serial.h View File

@@ -9,11 +9,15 @@ int prepare_UART(char *port, int bauds);
9 9
 int getbyte(int fd);				/* really brotched func */
10 10
 int putbyte(int fd, unsigned char byte);
11 11
 
12
+
13
+
12 14
 /* timeout is exprimed in milliseconds. */
13 15
 int getbyte_to (int fd, int to_ms);
14 16
 
15 17
 int getline_to(int fd, char *where, int szm, int to_ms);
16 18
 
19
+
20
+
17 21
 /* auxiliary and test functions */
18 22
 
19 23
 int parseXvalue(char *asciidatas, char id);

+ 2
- 2
serial/t.c View File

@@ -162,10 +162,10 @@ switch (param) {
162 162
 		retv = loop(serial_in, nbre);
163 163
 		break;
164 164
 	case 1:
165
-		retv = essai_terminal(serial_in, device, 0);
165
+		retv = -1;
166 166
 		break;
167 167
 	default:
168
-		retv = -1;
168
+		retv = -2;
169 169
 		break;
170 170
 	}
171 171
 

Loading…
Cancel
Save