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
wangjie
OpenXG-RAN
Commits
63d8931c
Commit
63d8931c
authored
Feb 18, 2020
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding a small delay before the first read
parent
d2190230
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
17 deletions
+8
-17
executables/nr-ru.c
executables/nr-ru.c
+2
-1
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+6
-16
No files found.
executables/nr-ru.c
View file @
63d8931c
...
...
@@ -640,8 +640,9 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
LOG_D
(
PHY
,
"Reading %d samples for slot %d (%p)
\n
"
,
samples_per_slot
,
*
slot
,
rxp
[
0
]);
//when the USRP starts, it initializes the timestamp to 0. We wait 10 frames until we program the first rx.
if
(
proc
->
first_rx
==
1
)
{
proc
->
timestamp_rx
=
0
;
proc
->
timestamp_rx
=
fp
->
samples_per_frame
*
1
0
;
proc
->
first_rx
=
0
;
}
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
63d8931c
...
...
@@ -288,27 +288,18 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1
s
->
usrp
->
set_gpio_attr
(
"FP0"
,
"OUT"
,
7
<<
7
,
0xf80
);
// init recv and send streaming
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
LOG_I
(
HW
,
"Time in secs now: %llu
\n
"
,
s
->
usrp
->
get_time_now
().
to_ticks
(
s
->
sample_rate
));
LOG_I
(
HW
,
"Time in secs last pps: %llu
\n
"
,
s
->
usrp
->
get_time_last_pps
().
to_ticks
(
s
->
sample_rate
));
if
(
s
->
use_gps
==
1
||
device
->
openair0_cfg
[
0
].
time_source
==
external
)
{
s
->
wait_for_first_pps
=
1
;
cmd
.
time_spec
=
s
->
usrp
->
get_time_last_pps
()
+
uhd
::
time_spec_t
(
1.0
);
}
else
{
s
->
wait_for_first_pps
=
0
;
cmd
.
time_spec
=
s
->
usrp
->
get_time_now
()
+
uhd
::
time_spec_t
(
0.005
);
}
cmd
.
stream_now
=
false
;
// start at constant delay
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
/*s->tx_md.time_spec = cmd.time_spec + uhd::time_spec_t(1-(double)s->tx_forward_nsamps/s->sample_rate);
s->tx_md.has_time_spec = true;
s->tx_md.start_of_burst = true;
s->tx_md.end_of_burst = false;*/
s
->
usrp
->
set_time_now
(
uhd
::
time_spec_t
(
0.0
));
s
->
rx_count
=
0
;
s
->
tx_count
=
0
;
s
->
first_tx
=
0
;
s
->
first_rx
=
0
;
s
->
rx_timestamp
=
0
;
return
0
;
}
...
...
@@ -325,12 +316,14 @@ static void trx_usrp_end(openair0_device *device) {
return
;
if
(
s
->
recplay_mode
!=
RECPLAY_REPLAYMODE
)
{
// not subframes replay
/*
s->rx_stream->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
//send a mini EOB packet
s->tx_md.end_of_burst = true;
s->tx_stream->send("", 0, s->tx_md);
s->tx_md.end_of_burst = false;
sleep(1);
*/
}
if
(
s
->
recplay_mode
==
RECPLAY_RECORDMODE
)
{
// subframes store
...
...
@@ -644,9 +637,6 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp ptimestamp,
int16x8_t
buff_tmp
[
2
][
nsamps2
];
#endif
if
(
ptimestamp
==
0
)
s
->
usrp
->
set_time_now
(
uhd
::
time_spec_t
(
0.0
));
uhd
::
stream_cmd_t
stream_cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_NUM_SAMPS_AND_DONE
);
stream_cmd
.
num_samps
=
nsamps
;
stream_cmd
.
stream_now
=
false
;
...
...
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