mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:55:07 -05:00
Include maximum clock frequency error in our dispersion
Add maxclockerror directive to set the stability of the clock (10 ppm by default) and include it in our dispersion.
This commit is contained in:
13
local.c
13
local.c
@@ -34,6 +34,7 @@
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "conf.h"
|
||||
#include "local.h"
|
||||
#include "localp.h"
|
||||
#include "memory.h"
|
||||
@@ -91,6 +92,8 @@ static DispersionNotifyListEntry dispersion_notify_list;
|
||||
static int precision_log;
|
||||
static double precision_quantum;
|
||||
|
||||
static double max_clock_error;
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
/* Define the number of increments of the system clock that we want
|
||||
@@ -157,6 +160,8 @@ LCL_Initialise(void)
|
||||
temp_comp_ppm = 0.0;
|
||||
|
||||
calculate_sys_precision();
|
||||
|
||||
max_clock_error = CNF_GetMaxClockError() * 1e-6;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
@@ -187,6 +192,14 @@ LCL_GetSysPrecisionAsQuantum(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
double
|
||||
LCL_GetMaxClockError(void)
|
||||
{
|
||||
return max_clock_error;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
LCL_AddParameterChangeHandler(LCL_ParameterChangeHandler handler, void *anything)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user