Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
31
Issues
31
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
024b4964
Commit
024b4964
authored
Sep 06, 2019
by
Tomasz Wlostowski
Committed by
Grzegorz Daniluk
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrs: added set_ptracker_average_samples() rt_ipc call
parent
9a4fabc1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
0 deletions
+38
-0
rt_ipc.c
ipc/rt_ipc.c
+12
-0
rt_ipc.h
ipc/rt_ipc.h
+10
-0
softpll_ng.c
softpll/softpll_ng.c
+15
-0
softpll_ng.h
softpll/softpll_ng.h
+1
-0
No files found.
ipc/rt_ipc.c
View file @
024b4964
...
...
@@ -204,6 +204,16 @@ static int rts_enable_ptracker_func(const struct minipc_pd *pd, uint32_t *args,
return
0
;
}
static
int
rts_set_average_samples_func
(
const
struct
minipc_pd
*
pd
,
uint32_t
*
args
,
void
*
ret
)
{
pstate
.
ipc_count
++
;
spll_set_ptracker_average_samples
((
int
)
args
[
0
],
(
int
)
args
[
1
]);
*
(
int
*
)
ret
=
0
;
return
0
;
}
static
int
rts_debug_command_func
(
const
struct
minipc_pd
*
pd
,
uint32_t
*
args
,
void
*
ret
)
{
pstate
.
ipc_count
++
;
...
...
@@ -228,6 +238,7 @@ int rtipc_init(void)
rtipc_rts_adjust_phase_struct
.
f
=
rts_adjust_phase_func
;
rtipc_rts_enable_ptracker_struct
.
f
=
rts_enable_ptracker_func
;
rtipc_rts_debug_command_struct
.
f
=
rts_debug_command_func
;
rtipc_rts_set_average_samples_struct
.
f
=
rts_set_average_samples_func
;
minipc_export
(
server
,
&
rtipc_rts_set_mode_struct
);
minipc_export
(
server
,
&
rtipc_rts_get_state_struct
);
...
...
@@ -235,6 +246,7 @@ int rtipc_init(void)
minipc_export
(
server
,
&
rtipc_rts_adjust_phase_struct
);
minipc_export
(
server
,
&
rtipc_rts_enable_ptracker_struct
);
minipc_export
(
server
,
&
rtipc_rts_debug_command_struct
);
minipc_export
(
server
,
&
rtipc_rts_set_average_samples_struct
);
return
0
;
...
...
ipc/rt_ipc.h
View file @
024b4964
...
...
@@ -187,6 +187,16 @@ static struct minipc_pd rtipc_rts_debug_command_struct = {
},
};
static
struct
minipc_pd
rtipc_rts_set_average_samples_struct
=
{
.
name
=
"gggg"
,
.
retval
=
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
.
args
=
{
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_ENCODE
(
MINIPC_ATYPE_INT
,
int
),
MINIPC_ARG_END
},
};
#endif
#endif
softpll/softpll_ng.c
View file @
024b4964
...
...
@@ -467,6 +467,21 @@ int spll_read_ptracker(int channel, int32_t *phase_ps, int *enabled)
return
st
->
ready
;
}
void
spll_set_ptracker_average_samples
(
int
channel
,
int
nsamples
)
{
struct
softpll_state
*
s
=
(
struct
softpll_state
*
)
&
softpll
;
struct
spll_ptracker_state
*
pt
=
&
s
->
ptrackers
[
channel
];
disable_irq
();
pt
->
preserve_sign
=
0
;
pt
->
ready
=
0
;
pt
->
acc
=
0
;
pt
->
avg_count
=
0
;
pt
->
n_avg
=
nsamples
;
enable_irq
();
}
void
spll_get_num_channels
(
int
*
n_ref
,
int
*
n_out
)
{
if
(
n_ref
)
...
...
softpll/softpll_ng.h
View file @
024b4964
...
...
@@ -108,6 +108,7 @@ int spll_get_dac(int out_channel);
void
check_vco_frequencies
(
void
);
int
spll_measure_frequency
(
int
osc
);
void
spll_set_ptracker_average_samples
(
int
channel
,
int
nsamples
);
/*
* Aux and main state:
...
...
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