Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
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
Beam Positoning Monitor - Software
Commits
1301bae2
Commit
1301bae2
authored
Feb 20, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/acq.c: fix missing channel number check
This fixes #81 github issue.
parent
e3d1dac4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
acq.c
examples/acq.c
+3
-3
No files found.
examples/acq.c
View file @
1301bae2
...
...
@@ -28,7 +28,7 @@
void
print_data
(
uint32_t
chan
,
uint32_t
*
data
,
uint32_t
size
)
{
/* FIXME: Make it more generic */
if
(
chan
==
0
||
chan
==
9
)
{
if
(
chan
==
0
/* Only ADC */
)
{
int16_t
*
raw_data16
=
(
int16_t
*
)
data
;
for
(
uint32_t
i
=
0
;
i
<
(
size
/
sizeof
(
uint16_t
))
/
4
;
i
++
)
{
if
(
zctx_interrupted
)
{
...
...
@@ -156,10 +156,10 @@ int main (int argc, char *argv [])
else
{
chan
=
strtoul
(
chan_str
,
NULL
,
10
);
if
(
chan
>
MAX_NUM_CHANS
)
{
if
(
chan
>
END_CHAN_ID
-
1
)
{
fprintf
(
stderr
,
"[client:acq]: Channel number too big! Defaulting to: %u
\n
"
,
MAX_NUM_CHANS
);
chan
=
MAX_NUM_CHANS
;
chan
=
END_CHAN_ID
-
1
;
}
}
//fprintf (stdout, "[client:acq]: chan = %u\n", chan);
...
...
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