Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
German Leon
Irradiar
Commits
48d8f7ed
Commit
48d8f7ed
authored
Feb 16, 2022
by
German Leon
Browse files
Poner close en iamalive
parent
e18f5f86
Changes
5
Hide whitespace changes
Inline
Side-by-side
bin/iamalive
View file @
48d8f7ed
No preview for this file type
bin/iamalive_ini
View file @
48d8f7ed
No preview for this file type
irradiacion/tools/iamalive.cpp
View file @
48d8f7ed
...
@@ -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
++
)
{
...
...
irradiacion/tools/iamalive_ini.cpp
View file @
48d8f7ed
...
@@ -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."
);
...
...
startup_script.sh
View file @
48d8f7ed
#!/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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment