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
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
misc
adc-lib
Commits
7de3cab6
Commit
7de3cab6
authored
Oct 22, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'tools: fix binary file writing' into develop
parents
a3407e56
2f029024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
adc-acq.c
tools/adc-acq.c
+2
-4
No files found.
tools/adc-acq.c
View file @
7de3cab6
...
...
@@ -171,7 +171,6 @@ static int timeout = -1;
static
int
loop
=
1
;
static
char
*
basefile
;
static
unsigned
int
nsamples
=
0
;
static
unsigned
int
ssize
=
0
;
static
char
*
_argv
[
16
];
static
uint32_t
nchan
;
...
...
@@ -888,7 +887,7 @@ static int fald_acq_write_single(struct adc_buffer *buf)
err
++
;
#endif
data
=
buf
->
data
;
if
(
fwrite
(
data
,
s
size
,
nsamples
,
f
)
!=
nsamples
)
if
(
fwrite
(
data
,
buf
->
sample
size
,
nsamples
,
f
)
!=
nsamples
)
err
++
;
if
(
err
)
{
...
...
@@ -939,7 +938,7 @@ static int fald_acq_write_multiple(struct adc_buffer *buf,
return
-
1
;
}
data
=
buf
->
data
;
if
(
fwrite
(
data
,
s
size
,
nsamples
,
f
)
if
(
fwrite
(
data
,
buf
->
sample
size
,
nsamples
,
f
)
!=
nsamples
)
{
fprintf
(
stderr
,
"write(%s): short write
\n
"
,
fname
);
return
-
1
;
...
...
@@ -1175,7 +1174,6 @@ int main(int argc, char *argv[])
adc_get_conf
(
&
cfg_acq
,
ADC_CONF_ACQ_N_BITS
,
&
bits
);
adc_get_conf
(
&
cfg_acq
,
ADC_CONF_ACQ_N_SHOTS
,
&
nshots
);
nsamples
=
pre
+
post
;
ssize
=
(
bits
+
(
8
-
1
))
/
8
;
/* get sample size - round up */
buf
=
adc_request_buffer
(
adc
,
nsamples
,
NULL
/* alloc */
,
0
);
if
(
!
buf
)
{
...
...
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