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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
e141b208
Commit
e141b208
authored
May 29, 2022
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPS sync improvements
parent
b30e6733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+10
-13
No files found.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
e141b208
...
...
@@ -201,16 +201,6 @@ static int sync_to_gps(openair0_device *device) {
LOG_W
(
HW
,
"WARNING: GPS not locked - time will not be accurate until locked
\n
"
);
}
//wait for next pps
uhd
::
time_spec_t
last
=
s
->
usrp
->
get_time_last_pps
();
uhd
::
time_spec_t
next
=
s
->
usrp
->
get_time_last_pps
();
while
(
next
==
last
)
{
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
50
));
last
=
next
;
next
=
s
->
usrp
->
get_time_last_pps
();
}
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
200
));
//Set to GPS time
uhd
::
time_spec_t
gps_time
=
uhd
::
time_spec_t
(
time_t
(
s
->
usrp
->
get_mboard_sensor
(
"gps_time"
,
mboard
).
to_int
()));
s
->
usrp
->
set_time_next_pps
(
gps_time
+
1.0
,
mboard
);
...
...
@@ -306,11 +296,18 @@ static int trx_usrp_start(openair0_device *device) {
//s->first_rx = 1;
s
->
rx_timestamp
=
0
;
uhd
::
time_spec_t
time_last_pps
=
s
->
usrp
->
get_time_last_pps
();
LOG_I
(
HW
,
"last pps at %f, starting streaming at %f
\n
"
,
time_last_pps
.
get_real_secs
(),
time_last_pps
.
get_real_secs
()
+
1.0
);
//wait for next pps
uhd
::
time_spec_t
last_pps
=
s
->
usrp
->
get_time_last_pps
();
uhd
::
time_spec_t
current_pps
=
s
->
usrp
->
get_time_last_pps
();
while
(
current_pps
==
last_pps
)
{
boost
::
this_thread
::
sleep
(
boost
::
posix_time
::
milliseconds
(
1
));
current_pps
=
s
->
usrp
->
get_time_last_pps
();
}
LOG_I
(
HW
,
"current pps at %f, starting streaming at %f
\n
"
,
current_pps
.
get_real_secs
(),
current_pps
.
get_real_secs
()
+
1.0
);
uhd
::
stream_cmd_t
cmd
(
uhd
::
stream_cmd_t
::
STREAM_MODE_START_CONTINUOUS
);
cmd
.
time_spec
=
uhd
::
time_spec_t
(
time_las
t_pps
+
1.0
);
cmd
.
time_spec
=
uhd
::
time_spec_t
(
curren
t_pps
+
1.0
);
cmd
.
stream_now
=
false
;
// start at constant delay
s
->
rx_stream
->
issue_stream_cmd
(
cmd
);
...
...
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