Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-php-extension
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-php-extension
Commits
dbced7b0
Commit
dbced7b0
authored
Nov 24, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Elphel/elphel-apps-php-extension
parents
c2a1f3eb
7c0c7388
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
elphel_php.c
src/ext/elphel/elphel_php.c
+9
-5
No files found.
src/ext/elphel/elphel_php.c
View file @
dbced7b0
...
@@ -904,15 +904,18 @@ PHP_FUNCTION(elphel_set_P_arr)
...
@@ -904,15 +904,18 @@ PHP_FUNCTION(elphel_set_P_arr)
int
reg_addr
,
reg_data
,
constAddNumber
;
int
reg_addr
,
reg_data
,
constAddNumber
;
long
multiMod
;
long
multiMod
;
long
broadcast
=
0
;
long
broadcast
=
0
;
unsigned
long
uframe
;
if
(
zend_parse_parameters
(
ZEND_NUM_ARGS
()
TSRMLS_CC
,
"la|lll"
,
&
port
,
&
arr
,
&
frame
,
&
flags
,
&
broadcast
)
==
FAILURE
)
{
if
(
zend_parse_parameters
(
ZEND_NUM_ARGS
()
TSRMLS_CC
,
"la|lll"
,
&
port
,
&
arr
,
&
frame
,
&
flags
,
&
broadcast
)
==
FAILURE
)
{
RETURN_LONG
(
num_written
);
RETURN_LONG
(
num_written
);
}
}
if
((
port
<
0
)
||
(
port
>=
SENSOR_PORTS
))
if
((
port
<
0
)
||
(
port
>=
SENSOR_PORTS
))
RETURN_NULL
();
RETURN_NULL
();
if
(
frame
<
0
)
{
if
(
frame
==
-
1
)
uframe
=
ELPHEL_GLOBALPARS
(
port
,
G_THIS_FRAME
)
+
FRAME_DEAFAULT_AHEAD
;
// old: use earliest frame
frame
=
ELPHEL_GLOBALPARS
(
port
,
G_THIS_FRAME
)
+
FRAME_DEAFAULT_AHEAD
;
else
if
(
frame
==
-
2
)
uframe
=
0xffffffffL
;
// (new nc393: use ASAP mode)
}
else
uframe
=
(
unsigned
long
)
frame
;
flags
|=
(
flags
<<
16
);
/// will accept flags both shifted and not shifted
flags
|=
(
flags
<<
16
);
/// will accept flags both shifted and not shifted
flags
&=
0xffff0000
;
flags
&=
0xffff0000
;
init_sens
();
init_sens
();
...
@@ -924,7 +927,7 @@ PHP_FUNCTION(elphel_set_P_arr)
...
@@ -924,7 +927,7 @@ PHP_FUNCTION(elphel_set_P_arr)
write_data
[
0
]
=
FRAMEPARS_SETFRAME
|
((
broadcast
<<
4
)
&
0xf0
);
write_data
[
0
]
=
FRAMEPARS_SETFRAME
|
((
broadcast
<<
4
)
&
0xf0
);
write_data
[
1
]
=
frame
;
write_data
[
1
]
=
u
frame
;
for
(
zend_hash_internal_pointer_reset_ex
(
arr_hash
,
&
pointer
);
for
(
zend_hash_internal_pointer_reset_ex
(
arr_hash
,
&
pointer
);
zend_hash_get_current_data_ex
(
arr_hash
,
(
void
**
)
&
data
,
&
pointer
)
==
SUCCESS
;
zend_hash_get_current_data_ex
(
arr_hash
,
(
void
**
)
&
data
,
&
pointer
)
==
SUCCESS
;
zend_hash_move_forward_ex
(
arr_hash
,
&
pointer
))
{
zend_hash_move_forward_ex
(
arr_hash
,
&
pointer
))
{
...
@@ -974,7 +977,8 @@ PHP_FUNCTION(elphel_set_P_arr)
...
@@ -974,7 +977,8 @@ PHP_FUNCTION(elphel_set_P_arr)
if
(
rslt
<
0
)
RETURN_LONG
(
-
errno
);
if
(
rslt
<
0
)
RETURN_LONG
(
-
errno
);
num_written
=
(
rslt
>>
3
)
-
1
;
///actually written to driver
num_written
=
(
rslt
>>
3
)
-
1
;
///actually written to driver
}
}
RETURN_LONG
(
frame
);
// RETURN_LONG(frame);
RETURN_LONG
(
(
long
)
uframe
);
}
}
/**
/**
...
...
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