Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
trx-ecpri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
trx-ecpri
Commits
e823f390
Commit
e823f390
authored
Jan 15, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
836f330e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
ring_buffer.c
ring_buffer.c
+25
-4
trx_ecpri.c
trx_ecpri.c
+4
-1
No files found.
ring_buffer.c
View file @
e823f390
...
...
@@ -91,13 +91,34 @@ static volatile char * rbuf_read(ring_buffer_t * rbuf, size_t * size) {
return
data
;
}
static
size_t
rbuf_contiguous_copy_single
(
ring_buffer_t
*
rbuf
,
size_t
block_size
,
size_t
max_blocks
)
{
size_t
n_blocks
;
if
(
!
rbuf
)
return
0
;
n_blocks
=
(
rbuf
->
len
-
rbuf
->
read_index
)
/
block_size
;
if
(
!
n_blocks
)
{
if
(
n_blocks
>
max_blocks
)
return
max_blocks
;
return
n_blocks
;
}
/* Returns maximum contiguous size on which rbuf_src can be copied to rbuf_dst */
static
size_t
rbuf_contiguous_copy
(
ring_buffer_t
*
rbuf_src
,
ring_buffer_t
*
rbuf_dst
,
size_t
n
)
{
size_t
ret
=
n
;
ring_buffer_t
*
rbuf_dst
,
size_t
block_size
,
size_t
max_blocks
)
{
size_t
n_blocks
;
if
(
rbuf_src
)
{
n
=
rbuf_src
->
len
-
rbuf_src
->
read_index
;
ret
=
n
<
ret
?
n
:
ret
;
max_size
=
rbuf_src
->
len
-
rbuf_src
->
read_index
;
if
(
size
>
max_size
)
{
size
=
max_size
;
}
else
if
(
size
<
min_size
)
{
index
=
0
;
size
=
}
size
=
max_size
<
size
?
max_size
:
size
;
}
if
(
rbuf_dst
)
n
=
rbuf_dst
->
len
-
rbuf_dst
->
write_index
;
...
...
trx_ecpri.c
View file @
e823f390
...
...
@@ -814,6 +814,7 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
log_debug
(
"TRX_ECPRI_WRITE"
,
"trx_ecpri_write, count = %ld"
,
count
/
N_SAMPLES
);
// Consistency check
if
(
prev_count
&&
((
timestamp
-
prev_timestamp
)
!=
prev_count
))
{
log_exit
(
"TRX_ECPRI_WRITE"
,
"Gap between timestamps: prev_ts %li ts %li prev_count %li count %li diff_ts %li"
,
...
...
@@ -821,6 +822,7 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
}
prev_timestamp
=
timestamp
;
prev_count
=
count
;
// Drop samples if we don't have enough space in trx write buffer
if
(
count
>
(
rbuf_write_amount
(
&
trxw_rbuf
[
0
])
/
sizeof
(
Complex
))
)
{
//log_exit("TRX_ECPRI_WRITE",
// "Not enough space to write in trxw_rbuf (count = %d)", count);
...
...
@@ -859,7 +861,8 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
- ptimestamp: number of total read IQ samples
- __samples: IQ samples returned
*/
static
int
trx_ecpri_read
(
TRXState
*
s1
,
trx_timestamp_t
*
ptimestamp
,
void
**
__samples
,
int
count
,
int
rx_port_index
,
TRXReadMetadata
*
md
)
static
int
trx_ecpri_read
(
TRXState
*
s1
,
trx_timestamp_t
*
ptimestamp
,
void
**
__samples
,
int
count
,
int
rx_port_index
,
TRXReadMetadata
*
md
)
{
int64_t
nc
,
count_left
,
offset
;
float
**
_samples
=
(
float
**
)
__samples
;
...
...
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