Commit 48d8f7ed authored by German Leon's avatar German Leon
Browse files

Poner close en iamalive

parent e18f5f86
No preview for this file type
No preview for this file type
...@@ -36,6 +36,7 @@ int main(int argc, char*argv[]) { ...@@ -36,6 +36,7 @@ int main(int argc, char*argv[]) {
fdf=fopen(buffer,"r"); fdf=fopen(buffer,"r");
fscanf (fdf,"%d",&valor); fscanf (fdf,"%d",&valor);
fprintf(stdout,"%.1f,",valor/1000.0); fprintf(stdout,"%.1f,",valor/1000.0);
fclose(fdf);
} }
for(i=0; i<3;i++) { for(i=0; i<3;i++) {
......
...@@ -79,7 +79,6 @@ int main(int argc, char*argv[]) { ...@@ -79,7 +79,6 @@ int main(int argc, char*argv[]) {
fprintf(stdout,"Code: %d \r\n", ident.options); fprintf(stdout,"Code: %d \r\n", ident.options);
} }
while (1) {
nom=getenv("MYHOME"); nom=getenv("MYHOME");
if (nom==NULL) if (nom==NULL)
sprintf(buffer,"./watchdog.log"); sprintf(buffer,"./watchdog.log");
...@@ -88,6 +87,7 @@ int main(int argc, char*argv[]) { ...@@ -88,6 +87,7 @@ int main(int argc, char*argv[]) {
if ( (fdl = fopen(buffer, "a") ) == NULL ) { if ( (fdl = fopen(buffer, "a") ) == NULL ) {
printf("Error! opening watchog.log file\n"); printf("Error! opening watchog.log file\n");
} }
while (1) {
sleep (timeslice); sleep (timeslice);
...@@ -110,6 +110,7 @@ int main(int argc, char*argv[]) { ...@@ -110,6 +110,7 @@ int main(int argc, char*argv[]) {
fdf=fopen(buffer,"r"); fdf=fopen(buffer,"r");
fscanf (fdf,"%d",&valor); fscanf (fdf,"%d",&valor);
fprintf(stdout,"%.1f,",valor/1000.0); fprintf(stdout,"%.1f,",valor/1000.0);
fclose(fdf);
} }
for(i=0; i<3;i++) { for(i=0; i<3;i++) {
sprintf(buffer,"/sys/bus/i2c/drivers/ina3221x/6-0040/iio:device0/rail_name_%d",i); sprintf(buffer,"/sys/bus/i2c/drivers/ina3221x/6-0040/iio:device0/rail_name_%d",i);
...@@ -129,10 +130,10 @@ int main(int argc, char*argv[]) { ...@@ -129,10 +130,10 @@ int main(int argc, char*argv[]) {
} }
fprintf (stdout,"\r\n"); fprintf (stdout,"\r\n");
fclose(fdl);
} // end while } // end while
fclose(fdl);
close(fd); close(fd);
if (ret<0) { if (ret<0) {
fprintf(stderr, "Failed to close watchdog device."); fprintf(stderr, "Failed to close watchdog device.");
......
#!/bin/bash #!/bin/bash
# start the four cores
#/home/ubuntu/bin/startcores
export MYHOME=$(echo $0|cut -d'/' -f1-3) export MYHOME=$(echo $0|cut -d'/' -f1-3)
cd $MYHOME cd $MYHOME
#chmod a+rw /dev/watchdog0 #chmod 0666 /dev/ttyS0
date>> reboot.log
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
# Nos vamos al directorio donde estan los test # Nos vamos al directorio donde estan los test
cd `grep -v \# dir_test` cd `grep -v \# dir_test`
#tools/serie.py echo "Solo lo mantenemos vivo..."
#$MYHOME/bin/serie.py
#/home/happy/bin/serie.py
if test -f "deleteindex.flag"; then if test -f "deleteindex.flag"; then
rm lastFiNumber deleteindex.flag rm lastFiNumber deleteindex.flag
fi fi
#/bin/bash $MYHOME/bin/iamalive
$MYHOME/bin/iamalive_ini 20 10 &
./test.sh
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment