Skip to content
Commits on Source (3)
......@@ -157,7 +157,9 @@ bool ntp_enable = true; /* clock discipline enabled */
bool pll_control = false; /* kernel support available */
bool kern_enable = true; /* kernel support enabled */
bool hardpps_enable; /* kernel PPS discipline enabled */
#ifdef HAVE_KERNEL_PLL
static bool ext_enable; /* external clock enabled */
#endif /* HAVE_KERNEL_PLL */
bool allow_panic = false; /* allow panic correction (-g) */
bool force_step_once = false; /* always step time once at startup (-G) */
bool mode_ntpdate = false; /* exit on first clock set (-q) */
......@@ -167,7 +169,9 @@ static int freq_set; /* initial set frequency switch */
/*
* Clock state machine variables
*/
#ifndef ENABLE_LOCKCLOCK
static int state = 0; /* clock discipline state */
#endif /* ENABLE_LOCKCLOCK */
uint8_t sys_poll; /* time constant/poll (log2 s) */
int tc_counter; /* jiggle counter */
double last_offset; /* last offset (s) */
......
......@@ -658,6 +658,7 @@ oncore_start(
if (stat(device1, &stat1)) {
oncore_log_f(instance, LOG_ERR, "Can't stat fd1 (%s)",
device1);
free(instance);
return false; /* exit, no file, can't start driver */
}
......
......@@ -127,52 +127,52 @@ TEST(binio, get_lsb_int324) {
TEST(binio, put_lsb_uint160) {
unsigned char ret[2] = { 0, 0};
unsigned char exp[2] = { 0, 0};
unsigned char expect[2] = { 0, 0};
unsigned char *bp = &ret[0];
put_lsb_uint16( &bp, 0);
TEST_ASSERT_EQUAL_HEX8_ARRAY( exp, ret, 2 );
TEST_ASSERT_EQUAL_HEX8_ARRAY( expect, ret, 2 );
}
TEST(binio, put_lsb_uint161) {
unsigned char ret[2] = { 0, 0};
unsigned char exp[2] = { 1, 0};
unsigned char expect[2] = { 1, 0};
unsigned char *bp = &ret[0];
put_lsb_uint16( &bp, 1);
TEST_ASSERT_EQUAL_HEX8_ARRAY( exp, ret, 2 );
TEST_ASSERT_EQUAL_HEX8_ARRAY( expect, ret, 2 );
}
TEST(binio, put_lsb_uint162) {
unsigned char ret[2] = { 0, 0};
unsigned char exp[2] = { 0, 1};
unsigned char expect[2] = { 0, 1};
unsigned char *bp = &ret[0];
put_lsb_uint16( &bp, 256);
TEST_ASSERT_EQUAL_HEX8_ARRAY( exp, ret, 2 );
TEST_ASSERT_EQUAL_HEX8_ARRAY( expect, ret, 2 );
}
TEST(binio, put_lsb_uint163) {
unsigned char ret[2] = { 0, 0};
unsigned char exp[2] = { 0xff, 0xff };
unsigned char expect[2] = { 0xff, 0xff };
unsigned char *bp = &ret[0];
put_lsb_uint16( &bp, 0xffff);
TEST_ASSERT_EQUAL_HEX8_ARRAY( exp, ret, 2 );
TEST_ASSERT_EQUAL_HEX8_ARRAY( expect, ret, 2 );
}
TEST(binio, put_lsb_uint164) {
unsigned char ret[2] = { 0, 0};
unsigned char exp[2] = { 1, 0x80};
unsigned char expect[2] = { 1, 0x80};
unsigned char *bp = &ret[0];
put_lsb_uint16( &bp, 0x8001);
TEST_ASSERT_EQUAL_HEX8_ARRAY( exp, ret, 2 );
TEST_ASSERT_EQUAL_HEX8_ARRAY( expect, ret, 2 );
}
......