Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
1ab26446
Commit
1ab26446
authored
Apr 24, 2018
by
baujc
Committed by
Adam Wujek
Nov 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code size optimization for bmc_m1() : 40 bytes
parent
c1d8b440
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
24 deletions
+22
-24
bmc.c
proto-standard/bmc.c
+22
-24
No files found.
proto-standard/bmc.c
View file @
1ab26446
...
...
@@ -29,6 +29,8 @@ void bmc_m1(struct pp_instance *ppi)
struct
DSTimeProperties
*
prop
=
DSPRO
(
ppi
);
int
ret
=
0
;
int
offset
,
leap59
,
leap61
;
Boolean
ptpTimescale
;
Enumeration8
timeSource
;
/* Current data set update */
DSCUR
(
ppi
)
->
stepsRemoved
=
0
;
...
...
@@ -48,39 +50,36 @@ void bmc_m1(struct pp_instance *ppi)
/* Time Properties data set */
/* based on the clock class we set the frequency traceable flags */
if
((
defds
->
clockQuality
.
clockClass
<
PP_PTP_CLASS_GM_UNLOCKED
)
||
(
defds
->
clockQuality
.
clockClass
<
PP_ARB_CLASS_GM_UNLOCKED
))
prop
->
frequencyTraceable
=
TRUE
;
else
prop
->
frequencyTraceable
=
FALSE
;
prop
->
frequencyTraceable
=
(
(
defds
->
clockQuality
.
clockClass
<
PP_PTP_CLASS_GM_UNLOCKED
)
||
(
defds
->
clockQuality
.
clockClass
<
PP_ARB_CLASS_GM_UNLOCKED
));
/* FIXME: if we don't know better we stay with theses values*/
ptpTimescale
=
TRUE
;
/* Default value */
timeSource
=
INTERNAL_OSCILLATOR
;
/* Default value */
switch
(
defds
->
clockQuality
.
clockClass
)
{
case
PP_PTP_CLASS_GM_LOCKED
:
case
PP_PTP_CLASS_GM_HOLDOVER
:
prop
->
ptpTimescale
=
TRUE
;
prop
->
timeSource
=
GPS
;
break
;
case
PP_PTP_CLASS_GM_UNLOCKED
:
prop
->
ptpTimescale
=
TRUE
;
prop
->
timeSource
=
INTERNAL_OSCILLATOR
;
break
;
timeSource
=
GPS
;
break
;
case
PP_ARB_CLASS_GM_LOCKED
:
case
PP_ARB_CLASS_GM_HOLDOVER
:
prop
->
ptpTimescale
=
FALSE
;
prop
->
timeSource
=
GPS
;
break
;
timeSource
=
GPS
;
/* No break here */
case
PP_ARB_CLASS_GM_UNLOCKED
:
prop
->
ptpTimescale
=
FALSE
;
prop
->
timeSource
=
INTERNAL_OSCILLATOR
;
ptpTimescale
=
FALSE
;
break
;
default:
/* FIXME: if we don't know better we stay with this */
prop
->
ptpTimescale
=
TRUE
;
prop
->
timeSource
=
INTERNAL_OSCILLATOR
;
case
PP_PTP_CLASS_GM_UNLOCKED
:
/* Take default values */
break
;
}
prop
->
timeSource
=
timeSource
;
prop
->
ptpTimescale
=
ptpTimescale
;
if
(
p
rop
->
p
tpTimescale
)
{
if
(
ptpTimescale
)
{
ret
=
ppi
->
t_ops
->
get_utc_offset
(
ppi
,
&
offset
,
&
leap59
,
&
leap61
);
if
(
ret
)
{
offset
=
PP_DEFAULT_UTC_OFFSET
;
...
...
@@ -91,8 +90,7 @@ void bmc_m1(struct pp_instance *ppi)
}
if
(
prop
->
currentUtcOffset
!=
offset
)
{
pp_diag
(
ppi
,
bmc
,
1
,
"New UTC offset: %i
\n
"
,
offset
);
pp_diag
(
ppi
,
bmc
,
1
,
"New UTC offset: %i
\n
"
,
offset
);
prop
->
currentUtcOffset
=
offset
;
ppi
->
t_ops
->
set
(
ppi
,
NULL
);
}
...
...
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