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
b6e2f0e0
Commit
b6e2f0e0
authored
May 18, 2022
by
Sagar Parsawar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gps time sync improvements
parent
78e96664
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+11
-0
No files found.
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
b6e2f0e0
...
@@ -201,10 +201,21 @@ static int sync_to_gps(openair0_device *device) {
...
@@ -201,10 +201,21 @@ static int sync_to_gps(openair0_device *device) {
LOG_W
(
HW
,
"WARNING: GPS not locked - time will not be accurate until locked
\n
"
);
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
//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
()));
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
);
s
->
usrp
->
set_time_next_pps
(
gps_time
+
1.0
,
mboard
);
//s->usrp->set_time_next_pps(uhd::time_spec_t(0.0));
//s->usrp->set_time_next_pps(uhd::time_spec_t(0.0));
//Wait for it to apply
//Wait for it to apply
//The wait is 2 seconds because N-Series has a known issue where
//The wait is 2 seconds because N-Series has a known issue where
//the time at the last PPS does not properly update at the PPS edge
//the time at the last PPS does not properly update at the PPS edge
...
...
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