Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bpm-sw
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
bpm
bpm-sw
Commits
8977a0e8
Commit
8977a0e8
authored
Sep 24, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sm_io/*/acq/*: protect HW against incompatible trigger types
parent
0ff87f99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
sm_io_acq_codes.h
src/sm_io/modules/acq/sm_io_acq_codes.h
+2
-1
sm_io_acq_exp.c
src/sm_io/modules/acq/sm_io_acq_exp.c
+12
-0
No files found.
src/sm_io/modules/acq/sm_io_acq_codes.h
View file @
8977a0e8
...
...
@@ -52,6 +52,7 @@ struct _smio_acq_data_block_t {
#define ACQ_BLOCK_OOR 4
/* Block number out of range */
#define ACQ_NUM_CHAN_OOR 5
/* Channel number out of range */
#define ACQ_COULD_NOT_READ 6
/* Could not read memory block */
#define ACQ_REPLY_END 7
/* End marker */
#define ACQ_TRIG_TYPE 7
/* Incompatible trigger type */
#define ACQ_REPLY_END 8
/* End marker */
#endif
src/sm_io/modules/acq/sm_io_acq_exp.c
View file @
8977a0e8
...
...
@@ -128,6 +128,17 @@ static int _acq_data_acquire (void *owner, void *args, void *ret)
return
-
ACQ_NUM_SAMPLES_OOR
;
}
/* If skip trigger is set, we must set post_trigger_samples to 0 */
uint32_t
trigger_type
=
0
;
err
=
_acq_get_trigger_type
(
self
,
&
trigger_type
);
ASSERT_TEST
(
err
==
-
ACQ_OK
,
"Could not check for trigger type"
,
err_acq_get_trig
);
if
(
trigger_type
==
TYPE_ACQ_CORE_SKIP
&&
num_samples_post
>
0
)
{
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_WARN
,
"[sm_io:acq] data_acquire: "
"Incompatible trigger type. Post trigger samples is greater than 0
\n
"
);
return
-
ACQ_TRIG_TYPE
;
}
DBE_DEBUG
(
DBG_SM_IO
|
DBG_LVL_TRACE
,
"[sm_io:acq] data_acquire:
\n
"
"
\t
Current acq params for channel #%u: number of pre-trigger samples = %u
\n
"
"
\t
number of post-trigger samples = %u, number of shots = %u
\n
"
,
...
...
@@ -205,6 +216,7 @@ static int _acq_data_acquire (void *owner, void *args, void *ret)
return
-
ACQ_OK
;
err_acq_get_trig:
err_acq_not_completed:
err_get_acq_handler:
return
err
;
...
...
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