Browse Source

preparation du plan B

phyto 3 months ago
parent
commit
1b03d60613
9 changed files with 46 additions and 21 deletions
  1. 17
    4
      build.sh
  2. 1
    1
      core/utils.c
  3. 3
    3
      serial/serial.c
  4. 1
    1
      simulator/rdtemp/rdtemp.ino
  5. 4
    0
      storage/Makefile
  6. 7
    0
      storage/t.c
  7. 1
    11
      ui/terminal.c
  8. 11
    1
      viz/curses/ecran.c
  9. 1
    0
      viz/curses/ecran.h

+ 17
- 4
build.sh View File

@@ -6,18 +6,31 @@
6 6
 function build
7 7
 {
8 8
 echo ============= $1 ==============
9
+curdir=${PWD}
9 10
 cd $1
10 11
 make t
11 12
 error=$?
12
-cd ..
13
-echo === error on $1 = ${error}
13
+cd ${curdir}
14
+
15
+if [ ${error} -ne 0 ]
16
+then
17
+	echo === error on $1 = ${error}
18
+	exit
19
+fi
14 20
 }
15 21
 
16 22
 # ------------------------------------------------------------------
23
+#
24
+#	euh, il faut parfois tweaker l'ordre de ces modules
25
+#
26
+modules=" core serial viz/curses ui audio storage "
17 27
 
18
-build serial
28
+for mod in ${modules}
29
+do
30
+	build $mod
31
+done
19 32
 
20
-build ui
33
+echo +++++++++++++++++++++++++++++++++++
21 34
 
22 35
 make essai
23 36
 

+ 1
- 1
core/utils.c View File

@@ -34,7 +34,7 @@ if (idx==16) {
34 34
 		fprintf(fp, "%02x ", buffer[foo]);
35 35
 		if (7==foo)	fprintf(fp, " ");
36 36
 		}
37
-	fprintf(fp, "  -   |");
37
+	fprintf(fp, "    |");
38 38
 	for (foo=0; foo<16; foo++) {
39 39
 		c = buffer[foo];
40 40
 		fprintf(fp, "%c", isprint(c) ? c : ' ');

+ 3
- 3
serial/serial.c View File

@@ -6,7 +6,7 @@
6 6
 #include  <string.h>
7 7
 #include <unistd.h>			//Used for UART
8 8
 #include <fcntl.h>			//Used for UART
9
-#include <termios.h>		//Used for UART
9
+#include <termios.h>			//Used for UART
10 10
 
11 11
 #include  "serial.h"
12 12
 
@@ -88,7 +88,7 @@ if (uart0 < 0)
88 88
 
89 89
 
90 90
 baudbits = baudrate2const(baudrate);
91
-#if DEBUG_LEVEL > 1
91
+#if DEBUG_LEVEL 
92 92
 fprintf(stderr, "%d -> 0x%04x\n", baudrate, baudbits);
93 93
 #endif
94 94
 
@@ -107,7 +107,7 @@ options.c_cc[VMIN] = 1;			/* ask for blocking read */
107 107
 tcflush(uart0, TCIOFLUSH);
108 108
 tcsetattr(uart0, TCSANOW, &options);
109 109
 
110
-tcflush(uart0, TCIFLUSH);		/* do it again, sam */
110
+tcflush(uart0, TCIOFLUSH);		/* do it again, sam */
111 111
 
112 112
 if (verbosity) {
113 113
 	fprintf(stderr, "%s %s uart0 = %d\n",

+ 1
- 1
simulator/rdtemp/rdtemp.ino View File

@@ -136,7 +136,7 @@ void loop() {
136 136
           break;          
137 137
       }
138 138
  } 
139
- delay(DELAI);
139
+ delay(parametres.delai);
140 140
 
141 141
  /* ETERNAL LOOP END HERE */
142 142
 }

+ 4
- 0
storage/Makefile View File

@@ -0,0 +1,4 @@
1
+
2
+
3
+t:	t.c Makefile
4
+	gcc -Wall $< -o $@

+ 7
- 0
storage/t.c View File

@@ -0,0 +1,7 @@
1
+#include  <stdio.h>
2
+
3
+int main(int argc, char *argv[])
4
+{
5
+fprintf(stderr, "storage tool\n");
6
+return 0;
7
+}

+ 1
- 11
ui/terminal.c View File

@@ -21,16 +21,6 @@ extern int	verbosity;
21 21
 
22 22
 int special_dumper(FILE *fp, unsigned char octet);
23 23
 
24
-/* ---------------------------------------------------------------- */
25
-static void bordure(WINDOW * w, char *texte, int type)
26
-{
27
-if (type)
28
-	box(w, 0, 0);
29
-else
30
-	wborder(w, '|', '|', '-', '-', '+', '+', '+', '+');
31
-wstandout(w); mvwaddstr(w, 0, 3, texte); wstandend(w);
32
-wrefresh(w);
33
-}
34 24
 /* ---------------------------------------------------------------- */
35 25
 static int interactive(WINDOW *glass, int fd_local, int fd_remote)
36 26
 {
@@ -98,7 +88,7 @@ do	{
98 88
 		received = wgetch(glass);
99 89
 		echo();
100 90
 
101
-#if DEBUG_LEVEL 
91
+#if DEBUG_LEVEL > 1 
102 92
 		sprintf(ligne, " got $%X '%c'\n", received,
103 93
 			isprint(received) ? received : '?'); 
104 94
 		waddstr(glass, ligne); wrefresh(glass);

+ 11
- 1
viz/curses/ecran.c View File

@@ -11,6 +11,16 @@
11 11
 
12 12
 extern int	verbosity;
13 13
 
14
+/* ---------------------------------------------------------------- */
15
+void bordure(WINDOW * w, char *texte, int type)
16
+{
17
+if (type)
18
+	box(w, 0, 0);
19
+else
20
+	wborder(w, '|', '|', '-', '-', '+', '+', '+', '+');
21
+wstandout(w); mvwaddstr(w, 0, 3, texte); wstandend(w);
22
+wrefresh(w);
23
+}
14 24
 /* ---------------------------------------------------------------- */
15 25
 int kbhit(void)
16 26
 {
@@ -29,7 +39,7 @@ else	{                // input
29 39
 	ungetch(ch);
30 40
 	}
31 41
 
32
-// restore block and echo
42
+    // restore block and echo
33 43
 echo();
34 44
 nodelay(stdscr, FALSE);
35 45
 

+ 1
- 0
viz/curses/ecran.h View File

@@ -6,6 +6,7 @@ int kbhit(void);			/* experimental */
6 6
 
7 7
 int fond_ecran(char *titre);
8 8
 int aff_message(char *);
9
+void bordure(WINDOW * w, char *texte, int type);
9 10
 
10 11
 
11 12
 int aff7segs_base(WINDOW * win, int lig, int col, int bits, int k);

Loading…
Cancel
Save