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
1a4152ac
Commit
1a4152ac
authored
Jan 20, 2025
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
cc07c8da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
46 deletions
+0
-46
trx_ecpri.c
trx_ecpri.c
+0
-46
No files found.
trx_ecpri.c
View file @
1a4152ac
...
...
@@ -523,52 +523,6 @@ static void *decode_thread(void *p) {
pthread_exit
(
EXIT_SUCCESS
);
}
static
void
*
decompress_thread
(
void
*
p
)
{
cpu_set_t
mask
;
TRXEcpriState
*
s
=
(
TRXEcpriState
*
)
p
;
int
rx_ready
=
0
;
const
float
mult
=
1
.
/
32767
.;
log_info
(
"DECOMPRESS_THREAD"
,
"Thread init"
);
// Set thread CPU affinity
CPU_ZERO
(
&
mask
);
CPU_SET
(
s
->
decompress_affinity
,
&
mask
);
if
(
sched_setaffinity
(
0
,
sizeof
(
mask
),
&
mask
))
error
(
EXIT_FAILURE
,
errno
,
"Could not set CPU affinity to CPU %d
\n
"
,
s
->
decompress_affinity
);
for
(;;)
{
int
n
=
rbuf_read_amount
(
&
rx_rbuf
);
if
(
n
)
{
for
(
int
j
=
0
;
j
<
n
;
j
++
)
{
int16_t
samples_int
[
256
];
const
uint8_t
*
rx_samples
=
RBUF_READ
(
rx_rbuf
,
uint8_t
)
+
22
;
// TODO : analyze seq_id, ecpri packet type etc... ?
// TODO : set rx_ready at some point (when ?)
if
(
rx_ready
)
{
memset
(
samples_int
,
0
,
512
);
decode_bf1
(
samples_int
,
rx_samples
,
16
);
decode_bf1
(
samples_int
+
64
,
rx_samples
+
60
,
16
);
decode_bf1
(
samples_int
+
128
,
rx_samples
+
120
,
16
);
decode_bf1
(
samples_int
+
192
,
rx_samples
+
180
,
16
);
int16_to_float
(
RBUF_WRITE
(
trx_read_rbuf
,
float
),
samples_int
,
256
,
mult
);
rbuf_update_read_index
(
&
rx_rbuf
);
rbuf_update_write_index
(
&
trx_read_rbuf
);
sem_post
(
&
trx_read_sem
);
}
}
}
else
{
pthread_mutex_lock
(
&
rx_mutex
);
pthread_cond_wait
(
&
rx_cond
,
&
rx_mutex
);
pthread_mutex_unlock
(
&
rx_mutex
);
}
}
pthread_exit
(
EXIT_SUCCESS
);
}
static
void
*
statistic_thread
(
void
*
p
)
{
struct
timespec
next
,
initial
;
int64_t
recv_stop
=
0
;
...
...
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