Merge branch 'master' of ssh://tetalab.org/tTh/DD2-monitor
krkrkr
This commit is contained in:
commit
95b1022974
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# dd2 monitoring
|
# dd2 monitoring
|
||||||
#
|
#
|
||||||
# buil the core functions, use with care
|
# build the core functions, use with care
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,12 +9,14 @@ typedef struct {
|
|||||||
int valid;
|
int valid;
|
||||||
|
|
||||||
char *input_device;
|
char *input_device;
|
||||||
|
int input_speed;
|
||||||
|
|
||||||
|
|
||||||
} Configuration;
|
} Configuration;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------- */
|
/* ---------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int set_default_config(Configuration *cfg);
|
||||||
int parse_config(char *fname, int flags);
|
int parse_config(char *fname, int flags);
|
||||||
int show_config(char *title);
|
int show_config(char *title);
|
||||||
|
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
# experimental config file
|
# experimental config file
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# serial input from the control cpu
|
||||||
|
|
||||||
input_device s /dev/ttyACM0
|
input_device s /dev/ttyACM0
|
||||||
input_speed s 9600
|
input_speed i 9600
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------
|
||||||
|
# --------------------------------------------------
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -74,6 +75,15 @@ while (fgets(line, SZ_STRINGS, fp))
|
|||||||
config.input_device = strdup(strtok(NULL, " \t"));
|
config.input_device = strdup(strtok(NULL, " \t"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (CMP("input_speed")) {
|
||||||
|
config.input_speed = atoi(strtok(NULL, " \t"));
|
||||||
|
#if DEBUG_LEVEL
|
||||||
|
fprintf(stderr, "input speed = %d\n", config.input_speed);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -90,6 +100,7 @@ if (verbosity) {
|
|||||||
|
|
||||||
printf("valid : %d\n", config.valid);
|
printf("valid : %d\n", config.valid);
|
||||||
printf("input device : %s\n", config.input_device);
|
printf("input device : %s\n", config.input_device);
|
||||||
|
printf("input speed : %d\n", config.input_speed);
|
||||||
|
|
||||||
puts("");
|
puts("");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -331,8 +331,8 @@ En fait, tout reste à faire. Mais ça peut être un beau projet
|
|||||||
aux implications et usages multiples.
|
aux implications et usages multiples.
|
||||||
|
|
||||||
Un couteau suisse de la capture du monde réel, un point pivot
|
Un couteau suisse de la capture du monde réel, un point pivot
|
||||||
de nos diverses interprétations du
|
de nos diverses interprétations de
|
||||||
monde\footnote{non, la terre n'est pas plate} et des interactions
|
l'univers\footnote{non, la terre n'est pas plate} et des interactions
|
||||||
étranges entre des paramètres sans relation clairement definie.
|
étranges entre des paramètres sans relation clairement definie.
|
||||||
|
|
||||||
% -------------------------------------------------------------------
|
% -------------------------------------------------------------------
|
||||||
|
@ -5,7 +5,7 @@ DATAFILE="foo.dat"
|
|||||||
TMPFILE="/tmp/dd2data"
|
TMPFILE="/tmp/dd2data"
|
||||||
|
|
||||||
IMAGE="graphe.png"
|
IMAGE="graphe.png"
|
||||||
NB_READ=15000
|
NB_READ=25000
|
||||||
|
|
||||||
./t -v -n ${NB_READ} -d ${DEVICE} | tee -a ${DATAFILE}
|
./t -v -n ${NB_READ} -d ${DEVICE} | tee -a ${DATAFILE}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user