Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
Michael Black
OpenXG-RAN
Commits
63c68100
Commit
63c68100
authored
Nov 23, 2016
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spawn a thread for frequency adjustments in USRP device driver
parent
8369af09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+13
-3
No files found.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
63c68100
...
@@ -360,7 +360,15 @@ static bool is_equal(double a, double b)
...
@@ -360,7 +360,15 @@ static bool is_equal(double a, double b)
return
std
::
fabs
(
a
-
b
)
<
std
::
numeric_limits
<
double
>::
epsilon
();
return
std
::
fabs
(
a
-
b
)
<
std
::
numeric_limits
<
double
>::
epsilon
();
}
}
/*! \brief Set frequencies (TX/RX)
void
*
freq_thread
(
void
*
arg
)
{
openair0_device
*
device
=
(
openair0_device
*
)
arg
;
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
s
->
usrp
->
set_tx_freq
(
device
->
openair0_cfg
[
0
].
tx_freq
[
0
]);
s
->
usrp
->
set_rx_freq
(
device
->
openair0_cfg
[
0
].
rx_freq
[
0
]);
}
/*! \brief Set frequencies (TX/RX). Spawns a thread to handle the frequency change to not block the calling thread
* \param device the hardware to use
* \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application
* \param openair0_cfg RF frontend parameters set by application
* \param dummy dummy variable not used
* \param dummy dummy variable not used
...
@@ -369,10 +377,12 @@ static bool is_equal(double a, double b)
...
@@ -369,10 +377,12 @@ static bool is_equal(double a, double b)
int
trx_usrp_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
dummy
)
{
int
trx_usrp_set_freq
(
openair0_device
*
device
,
openair0_config_t
*
openair0_cfg
,
int
dummy
)
{
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
usrp_state_t
*
s
=
(
usrp_state_t
*
)
device
->
priv
;
pthread_t
f_thread
;
printf
(
"Setting USRP TX Freq %f, RX Freq %f
\n
"
,
openair0_cfg
[
0
].
tx_freq
[
0
],
openair0_cfg
[
0
].
rx_freq
[
0
]);
printf
(
"Setting USRP TX Freq %f, RX Freq %f
\n
"
,
openair0_cfg
[
0
].
tx_freq
[
0
],
openair0_cfg
[
0
].
rx_freq
[
0
]);
s
->
usrp
->
set_tx_freq
(
openair0_cfg
[
0
].
tx_freq
[
0
]);
s
->
usrp
->
set_rx_freq
(
openair0_cfg
[
0
].
rx_freq
[
0
]);
// spawn a thread to handle the frequency change to not block the calling thread
pthread_create
(
&
f_thread
,
NULL
,
freq_thread
,(
void
*
)
device
);
return
(
0
);
return
(
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