Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
adc-lib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
adc-lib
Commits
1e40c00a
Commit
1e40c00a
authored
Sep 06, 2021
by
Tristan Gingold
Committed by
Federico Vaga
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/adc-acq.c: allow floating point values to sw trigger delay
parent
e06d2fc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
adc-acq.c
tools/adc-acq.c
+18
-20
No files found.
tools/adc-acq.c
View file @
1e40c00a
...
...
@@ -555,11 +555,11 @@ static int fald_acq_channel_configuration(struct adc_dev *adc, char *param)
*/
static
int
fald_trg_software_configuration
(
struct
adc_dev
*
adc
,
char
*
param
)
{
uint32_t
delay
;
double
delay
;
int
ret
;
ret
=
sscanf
(
param
,
"%
u
"
,
&
delay
);
if
(
ret
<=
0
)
{
/* channel
is mandatory */
ret
=
sscanf
(
param
,
"%
lf
"
,
&
delay
);
if
(
ret
!=
1
)
{
/* delay
is mandatory */
errno
=
EINVAL
;
return
-
1
;
}
...
...
@@ -569,16 +569,8 @@ static int fald_trg_software_configuration(struct adc_dev *adc, char *param)
errno
=
ADC_ENOP
;
return
-
1
;
}
arg_trgsw
=
1
;
switch
(
ret
)
{
case
1
:
arg_trgsw_delay
=
delay
;
break
;
default:
errno
=
EINVAL
;
return
-
1
;
}
arg_trgsw
=
1
;
arg_trgsw_delay
=
delay
*
1000000
;
return
0
;
}
...
...
@@ -1220,18 +1212,24 @@ static int adc_acq_acquisition(struct adc_dev *adc,
adc_get_conf
(
cfg_acq
,
ADC_CONF_ACQ_PRE_SAMP
,
&
pre
);
adc_get_conf
(
cfg_acq
,
ADC_CONF_ACQ_POST_SAMP
,
&
post
);
adc_get_conf
(
cfg_acq
,
ADC_CONF_ACQ_N_SHOTS
,
&
nshots
);
if
(
arg_trgsw_delay
)
{
for
(
k
=
0
;
k
<
nshots
;
++
k
)
{
usleep
(
arg_trgsw_delay
);
err
=
adc_trigger_fire
(
adc
);
if
(
err
)
{
fprintf
(
stderr
,
"Cannot fire sw trigger: (%d) %s
\n
"
,
errno
,
adc_strerror
(
errno
));
goto
err
;
}
}
}
for
(
k
=
0
;
k
<
nshots
;
++
k
)
{
fprintf
(
stderr
,
"shot: %i/%u, nsamples: %u
\n
"
,
k
+
1
,
nshots
,
pre
+
post
);
if
(
arg_trgsw
)
{
sleep
(
arg_trgsw_delay
);
err
=
adc_trigger_fire
(
adc
);
if
(
err
)
goto
err
;
}
tv
.
tv_sec
=
60
;
err
=
adc_fill_buffer
(
adc
,
buf
,
fixup
?
ADC_F_FIXUP
:
0
,
...
...
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