Browse Source

il y a clairement une probleme hardware

phyto 6 months ago
parent
commit
0ccf834e84
4 changed files with 11 additions and 6 deletions
  1. 2
    2
      build.sh
  2. 1
    1
      serial/serial.c
  3. 1
    2
      simulator/rdtemp/rdtemp.ino
  4. 7
    1
      ui/terminal.c

+ 2
- 2
build.sh View File

@@ -5,12 +5,12 @@
5 5
 
6 6
 function build
7 7
 {
8
-echo === $1 ===
8
+echo ============= $1 ==============
9 9
 cd $1
10 10
 make t
11 11
 error=$?
12 12
 cd ..
13
-echo error ${error}
13
+echo === error on $1 = ${error}
14 14
 }
15 15
 
16 16
 # ------------------------------------------------------------------

+ 1
- 1
serial/serial.c View File

@@ -211,7 +211,7 @@ int getline_to(int fd, char *where, int szm, int to_ms)
211 211
 {
212 212
 int	curpos, byte, retval;
213 213
 
214
-#if DEBUG_LEVEL
214
+#if DEBUG_LEVEL > 1
215 215
 fprintf(stderr, ">>> %s ( %d %p %d %d )\n", __func__,
216 216
 				fd, where, szm, to_ms);
217 217
 #endif

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

@@ -33,14 +33,13 @@ void setup() {
33 33
   pinMode(RELAIS_FRIGO, OUTPUT);
34 34
   pinMode(RELAIS_VENTILO, OUTPUT);
35 35
   
36
-  Serial.print("\n");  
36
+  Serial.print("M booting\n");  
37 37
   /* XXX */
38 38
   /*  changing the voltage reference of the ADC
39 39
    *  greatly increase the prcision on the limited
40 40
    *  range of our temperatures.
41 41
    */
42 42
   analogReference(INTERNAL1V1); // Pour Arduino Mega2560
43
-  Serial.print("\n");
44 43
   read_config(0, &parametres);
45 44
   // display_config(&parametres);  
46 45
   Serial.print("M running now\n");

+ 7
- 1
ui/terminal.c View File

@@ -4,6 +4,7 @@
4 4
  
5 5
 #include  <stdio.h>
6 6
 #include  <string.h>
7
+#include  <ctype.h>
7 8
 #include <unistd.h>
8 9
 #include <stdlib.h>
9 10
 #include  <errno.h>
@@ -83,6 +84,11 @@ do	{
83 84
 			fflush(stderr);
84 85
 			}
85 86
 
87
+		if ( -1 == received) { 		/* anti ddos */
88
+			sleep(1);
89
+			waddstr(glass, " lost connection ?\n");
90
+			}
91
+
86 92
 		if ('\r' != received) waddch(glass, received);
87 93
 		}
88 94
 
@@ -96,9 +102,9 @@ do	{
96 102
 		sprintf(ligne, " got $%X '%c'\n", received,
97 103
 			isprint(received) ? received : '?'); 
98 104
 		waddstr(glass, ligne); wrefresh(glass);
105
+		sleep(1);
99 106
 #endif
100 107
 
101
-		if (0==received)	sleep(1);	/* anti ddos */
102 108
 
103 109
 		/* que doit-on faire avec ce qu'on
104 110
 			vient de recevoir ? */

Loading…
Cancel
Save