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
ZhouShuya
OpenXG-RAN
Commits
d0996837
Commit
d0996837
authored
Feb 25, 2017
by
rubuntun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix timestamp interpolation
parent
1a6c0287
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp
targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp
+15
-5
No files found.
targets/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp
View file @
d0996837
...
@@ -168,6 +168,7 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
...
@@ -168,6 +168,7 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
static
long
long
nextTime
;
static
long
long
nextTime
;
static
bool
nextTimeValid
=
false
;
static
bool
nextTimeValid
=
false
;
iris_state_t
*
s
=
(
iris_state_t
*
)
device
->
priv
;
iris_state_t
*
s
=
(
iris_state_t
*
)
device
->
priv
;
bool
time_set
=
false
;
long
long
timeNs
=
0
;
long
long
timeNs
=
0
;
int
flags
=
0
;
int
flags
=
0
;
int
samples_received
=
0
;
int
samples_received
=
0
;
...
@@ -200,20 +201,29 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
...
@@ -200,20 +201,29 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
{
{
if
(
flags
&
SOAPY_SDR_HAS_TIME
)
if
(
flags
&
SOAPY_SDR_HAS_TIME
)
{
{
s
->
rx_timestamp
=
SoapySDR
::
timeNsToTicks
(
timeNs
,
s
->
sample_rate
);
*
ptimestamp
=
s
->
rx_timestamp
;
nextTime
=
timeNs
;
nextTime
=
timeNs
;
nextTimeValid
=
true
;
nextTimeValid
=
true
;
time_set
=
true
;
//printf("1) time set %llu \n", *ptimestamp);
}
}
}
}
}
}
if
(
samples_received
<
nsamps
)
if
(
samples_received
<
nsamps
)
printf
(
"[recv] received %d samples out of %d
\n
"
,
samples_received
,
nsamps
);
printf
(
"[recv] received %d samples out of %d
\n
"
,
samples_received
,
nsamps
);
s
->
rx_count
+=
samples_received
;
if
(
s
->
sample_rate
!=
0
&&
nextTimeValid
)
if
(
s
->
sample_rate
!=
0
&&
nextTimeValid
)
{
{
s
->
rx_count
+=
samples_received
;
if
(
!
time_set
)
s
->
rx_timestamp
=
SoapySDR
::
timeNsToTicks
(
nextTime
,
s
->
sample_rate
);
{
*
ptimestamp
=
s
->
rx_timestamp
;
s
->
rx_timestamp
=
SoapySDR
::
timeNsToTicks
(
nextTime
,
s
->
sample_rate
);
*
ptimestamp
=
s
->
rx_timestamp
;
//printf("2) time set %llu, nextTime will be %llu \n", *ptimestamp, nextTime);
}
nextTime
+=
SoapySDR
::
ticksToTimeNs
(
samples_received
,
s
->
sample_rate
);
nextTime
+=
SoapySDR
::
ticksToTimeNs
(
samples_received
,
s
->
sample_rate
);
}
}
...
...
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