Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-autocampars
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-apps-autocampars
Commits
0710d0b7
Commit
0710d0b7
authored
Mar 29, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable framepars even if driver is disabled
parent
20bec9b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
18 deletions
+48
-18
autocampars.php
src/autocampars.php
+48
-18
No files found.
src/autocampars.php
View file @
0710d0b7
...
@@ -261,7 +261,7 @@ $GLOBALS['configs'] = array();
...
@@ -261,7 +261,7 @@ $GLOBALS['configs'] = array();
$GLOBALS
[
'init'
]
=
false
;
$GLOBALS
[
'init'
]
=
false
;
$GLOBALS
[
'daemon'
]
=
false
;
$GLOBALS
[
'daemon'
]
=
false
;
$GLOBALS
[
'driver_disabler'
]
=
$GLOBALS
[
'configDir'
]
.
"/disable_driver"
;
$GLOBALS
[
'driver_disabler
_file
'
]
=
$GLOBALS
[
'configDir'
]
.
"/disable_driver"
;
log_open
();
log_open
();
...
@@ -782,6 +782,8 @@ function detect_camera(){
...
@@ -782,6 +782,8 @@ function detect_camera(){
case
'BITSTREAM'
:
case
'BITSTREAM'
:
// ***** Sensor detection stage is the same for all sensors so far, can be combined Eyesis/non-Eyesis
// ***** Sensor detection stage is the same for all sensors so far, can be combined Eyesis/non-Eyesis
$frame_nums
=
array
(
-
1
,
-
1
,
-
1
,
-
1
);
$frame_nums
=
array
(
-
1
,
-
1
,
-
1
,
-
1
);
if
(
!
is_file
(
$GLOBALS
[
'driver_disabler_file'
])){
// Open files for only enabled channels
// Open files for only enabled channels
foreach
(
$GLOBALS
[
'ports'
]
as
$port
)
{
foreach
(
$GLOBALS
[
'ports'
]
as
$port
)
{
$f
=
fopen
(
$GLOBALS
[
'framepars_paths'
]
[
$port
],
"w+"
);
$f
=
fopen
(
$GLOBALS
[
'framepars_paths'
]
[
$port
],
"w+"
);
...
@@ -794,6 +796,15 @@ function detect_camera(){
...
@@ -794,6 +796,15 @@ function detect_camera(){
fclose
(
$f
);
fclose
(
$f
);
log_msg
(
"Started detection for sensor port "
.
$port
);
log_msg
(
"Started detection for sensor port "
.
$port
);
}
}
}
else
{
// init framepars anyways - sysfs was updated earlier
for
(
$port
=
0
;
$port
<
4
;
$port
++
){
$f
=
fopen
(
$GLOBALS
[
'framepars_paths'
][
$port
],
"w+"
);
fseek
(
$f
,
ELPHEL_LSEEK_FRAMEPARS_INIT
,
SEEK_END
);
fclose
(
$f
);
}
}
log_msg
(
"System FPGA version: "
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/fpga_version'
)),
3
);
log_msg
(
"System FPGA version: "
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/fpga_version'
)),
3
);
log_msg
(
"Sensor interface type: "
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/fpga_sensor_interface'
)),
3
);
log_msg
(
"Sensor interface type: "
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/fpga_sensor_interface'
)),
3
);
log_msg
(
"All frames:
\n
"
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/all_frames'
)),
0
);
log_msg
(
"All frames:
\n
"
.
trim
(
file_get_contents
(
'/sys/devices/soc0/elphel393-framepars@0/all_frames'
)),
0
);
...
@@ -1290,6 +1301,24 @@ function update_sysfs_sensors()
...
@@ -1290,6 +1301,24 @@ function update_sysfs_sensors()
log_msg
(
"Updated sysfs sensor map"
);
log_msg
(
"Updated sysfs sensor map"
);
}
}
/** Disable sensors per port, per subchannel to sysfs */
function
disable_sysfs_sensors
(){
for
(
$port
=
0
;
$port
<
4
;
$port
++
){
for
(
$chn
=
0
;
$chn
<
4
;
$chn
++
){
$f
=
fopen
(
$GLOBALS
[
'sysfs_detect_sensors'
]
.
'/sensor'
.
$port
.
$chn
,
'w'
);
fprintf
(
$f
,
"%s"
,
'none'
);
fclose
(
$f
);
}
}
for
(
$port
=
0
;
$port
<
4
;
$port
++
){
$f
=
fopen
(
$GLOBALS
[
'sysfs_detect_sensors'
]
.
'/port_mux'
.
$port
,
'w'
);
fprintf
(
$f
,
"%s"
,
'none'
);
fclose
(
$f
);
}
// re-read from sysfs, re-set $GLOBALS['ports'] and $GLOBALS['master_port']
log_msg
(
"Disabled sensors in sysfs sensor map"
);
}
function
colorize
(
$string
,
$color
,
$bold
)
{
function
colorize
(
$string
,
$color
,
$bold
)
{
$color
=
strtoupper
(
$color
);
$color
=
strtoupper
(
$color
);
$attr
=
array
();
$attr
=
array
();
...
@@ -1418,14 +1447,15 @@ function get_application_mode() {
...
@@ -1418,14 +1447,15 @@ function get_application_mode() {
log_msg
(
"10389 board not present"
);
log_msg
(
"10389 board not present"
);
}
else
{
}
else
{
// disable driver here
if
(
is_file
(
$GLOBALS
[
'driver_disabler_file'
])){
if
(
is_file
(
$GLOBALS
[
'driver_disabler'
])){
log_msg
(
"Ports will be disabled - found "
.
$GLOBALS
[
'driver_disabler_file'
]
.
" flag file"
);
$mode
=
0
;
//disable ports via sysfs
}
else
{
disable_sysfs_sensors
();
$mode
=
intval
(
$xml
->
mode
);
}
}
log_msg
(
'Application - '
.
((
string
)
$xml
->
app
)
.
', mode: '
.
((
string
)
$mode
)
.
"
\n
"
,
3
);
$mode
=
intval
(
$xml
->
mode
);
log_msg
(
'Application - '
.
((
string
)
$xml
->
app
)
.
', mode: '
.
$mode
.
"
\n
"
,
3
);
$GLOBALS
[
'camera_state_arr'
]
[
'rev10389'
]
=
''
.
$xml
->
rev
;
$GLOBALS
[
'camera_state_arr'
]
[
'rev10389'
]
=
''
.
$xml
->
rev
;
if
(((
string
)
$xml
->
app
)
!=
''
)
{
if
(((
string
)
$xml
->
app
)
!=
''
)
{
$GLOBALS
[
'camera_state_arr'
]
[
'application'
]
=
''
.
$xml
->
app
;
$GLOBALS
[
'camera_state_arr'
]
[
'application'
]
=
''
.
$xml
->
app
;
...
...
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