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
79faba82
Commit
79faba82
authored
Aug 09, 2016
by
Janito Vaqueiro Ferreira Filho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sm_io/modules/acq: use helper alignment function
Avoid adding unnecessary padding and simplify the code.
parent
219805fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
sm_io_acq_exp.c
src/sm_io/modules/acq/sm_io_acq_exp.c
+7
-8
No files found.
src/sm_io/modules/acq/sm_io_acq_exp.c
View file @
79faba82
...
...
@@ -114,7 +114,7 @@ static int _acq_data_acquire (void *owner, void *args, void *ret)
return
-
ACQ_NUM_CHAN_OOR
;
}
/* number of samples required is out of the maximum limit. Maixmum number of samples
/* number of samples required is out of the maximum limit. Maixmum number of samples
* in multishot mode is simply the maximum number of samples of the DPRAM. The DPRAM
* size is calculated to fit the largest sample in the design, so we are safe. */
uint32_t
max_samples_multishot
=
ACQ_CORE_MULTISHOT_MEM_SIZE
;
...
...
@@ -163,11 +163,10 @@ static int _acq_data_acquire (void *owner, void *args, void *ret)
* acquisition channel sample size */
uint32_t
samples_alignment
=
DDR3_PAYLOAD_SIZE
/
acq
->
acq_buf
[
chan
].
sample_size
;
uint32_t
num_samples_pre_aligned
=
num_samples_pre
+
samples_alignment
-
(
num_samples_pre
%
samples_alignment
);
uint32_t
num_samples_post_aligned
=
(
num_samples_post
==
0
)
?
0
:
num_samples_post
+
samples_alignment
-
(
num_samples_post
%
samples_alignment
);
uint32_t
num_samples_pre_aligned
=
hutils_align_value
(
num_samples_pre
,
samples_alignment
);
uint32_t
num_samples_post_aligned
=
hutils_align_value
(
num_samples_post
,
samples_alignment
);
/* Set the parameters: number of samples of this channel */
acq
->
acq_params
[
chan
].
num_samples_pre
=
num_samples_pre_aligned
;
...
...
@@ -401,8 +400,8 @@ static int _acq_get_data_block (void *owner, void *args, void *ret)
* sample_size
* */
/* First step if to get the trigger address from the channel.
* Even on skip trigger mode, this will contain the address after
/* First step if to get the trigger address from the channel.
* Even on skip trigger mode, this will contain the address after
* the last valid sample (end of acquisition address) */
uint32_t
acq_core_trig_addr
=
acq
->
acq_params
[
chan
].
trig_addr
;
...
...
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