Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow one to set utc_timescale via config. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,7 @@ struct clock *clock_create(enum clock_type type, struct config *config,
max_adj = sysclk_max_freq();
sysclk_set_leap(0);
}
c->utc_timescale = config_get_int(config, NULL, "utc_timescale");
c->utc_offset_set = 0;
c->leap_set = 0;
c->time_flags = c->utc_timescale ? 0 : PTP_TIMESCALE;
Expand Down
1 change: 1 addition & 0 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ struct config_item config_tab[] = {
GLOB_ITEM_INT("use_syslog", 1, 0, 1),
GLOB_ITEM_STR("userDescription", ""),
GLOB_ITEM_INT("utc_offset", CURRENT_UTC_OFFSET, 0, INT_MAX),
GLOB_ITEM_INT("utc_timescale", 0, 0, 1),
GLOB_ITEM_INT("verbose", 0, 0, 1),
GLOB_ITEM_INT("write_phase_mode", 0, 0, 1),
};
Expand Down
5 changes: 5 additions & 0 deletions ptp4l.8
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,11 @@ The user description string. Allowed values are of the form
name;location and contain at most 128 utf8 symbols. The default is an
empty string.

.TP
.B utc_timescale
By default TAI timescale is used in case of HW timestamping and UTC for
SW timestamps. One can override this with the setting. Allowed values 0, 1.

.TP
.B utc_offset
The current offset between TAI and UTC.
Expand Down