Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-init
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-init
Commits
4e330ce7
Commit
4e330ce7
authored
Dec 23, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
10389 board not present case
parent
ff7dbb03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
24 deletions
+30
-24
init_elphel393.py
src/init_elphel393.py
+30
-24
No files found.
src/init_elphel393.py
View file @
4e330ce7
...
...
@@ -133,34 +133,40 @@ def init_autoexp_daemon(index):
shout
(
"autoexposure -p "
+
index
+
" -c 0 -b 0 -d 1 &"
)
def
init_sata
(
sata_en
,
pydir
):
if
(
sata_en
==
1
):
if
not
get_fpga
():
log_msg
(
"Waiting for the FPGA to be programmed to start SATA"
,
4
)
if
not
fpga_OK
(
TIMEOUT
):
print
()
log_msg
(
"Timeout while waiting for the FPGA to be programmed"
,
2
)
return
else
:
log_msg
(
"Done waiting for the FPGA"
,
4
)
shout
(
pydir
+
"/x393sata.py"
)
# Should be after modprobe? Wait for the FPGA should be before it
shout
(
"modprobe ahci_elphel &"
)
shout
(
"sleep 2"
)
shout
(
"echo 1 > /sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module"
)
if
os
.
path
.
isfile
(
"/sys/devices/soc0/elphel393-pwr@0/detected_10389"
):
if
(
sata_en
==
1
):
if
not
get_fpga
():
log_msg
(
"Waiting for the FPGA to be programmed to start SATA"
,
4
)
if
not
fpga_OK
(
TIMEOUT
):
print
()
log_msg
(
"Timeout while waiting for the FPGA to be programmed"
,
2
)
return
else
:
log_msg
(
"Done waiting for the FPGA"
,
4
)
shout
(
pydir
+
"/x393sata.py"
)
# Should be after modprobe? Wait for the FPGA should be before it
shout
(
"modprobe ahci_elphel &"
)
shout
(
"sleep 2"
)
shout
(
"echo 1 > /sys/devices/soc0/amba@0/80000000.elphel-ahci/load_module"
)
else
:
log_msg
(
"10389 was not detected: skipping SATA init"
)
def
init_usb_hub
():
"""
Initializes USB HUB on 10389 board (stays init
u
ialized through reboot, does not respond after initialized)
Initializes USB HUB on 10389 board (stays initialized through reboot, does not respond after initialized)
"""
if
not
os
.
path
.
exists
(
'/sys/bus/usb/devices/1-1'
):
shout
(
"i2cset -y 0 0x2c 0xff 0x0201 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0x00 0x3401 w"
)
shout
(
"i2cset -y 0 0x2c 0x01 0x1201 w"
)
shout
(
"i2cset -y 0 0x2c 0x06 0x9b01 w"
)
shout
(
"i2cset -y 0 0x2c 0x07 0x1001 w"
)
shout
(
"i2cset -y 0 0x2c 0x08 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0101 w"
)
log_msg
(
"Initialized USB hub with Vendor=1234"
)
if
os
.
path
.
isfile
(
'/sys/devices/soc0/elphel393-pwr@0/detected_10389'
):
shout
(
"i2cset -y 0 0x2c 0xff 0x0201 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0x00 0x3401 w"
)
shout
(
"i2cset -y 0 0x2c 0x01 0x1201 w"
)
shout
(
"i2cset -y 0 0x2c 0x06 0x9b01 w"
)
shout
(
"i2cset -y 0 0x2c 0x07 0x1001 w"
)
shout
(
"i2cset -y 0 0x2c 0x08 0x0001 w"
)
shout
(
"i2cset -y 0 0x2c 0xff 0x0101 w"
)
log_msg
(
"Initialized USB hub with Vendor=1234"
)
else
:
log_msg
(
"10389 was not detected: skipping USB hub init"
)
else
:
log_msg
(
"USB hub was already initialized"
)
...
...
@@ -249,7 +255,7 @@ else:
log_msg
(
"skip imgsrv"
)
#5
log_msg
(
sys
.
argv
[
0
]
+
": auto exposure
and auto white balance
"
)
log_msg
(
sys
.
argv
[
0
]
+
": auto exposure
daemon
"
)
if
switch
[
'autoexp_daemon'
]
==
1
:
for
i
in
range
(
1
,
5
):
init_autoexp_daemon
(
str
(
i
-
1
))
...
...
Write
Preview
Markdown
is supported
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