sys_timex: rename status variable
This commit is contained in:
parent
0773a1e630
commit
4fe0e6b7fd
1 changed files with 13 additions and 13 deletions
26
sys_timex.c
26
sys_timex.c
|
@ -61,7 +61,7 @@
|
|||
#define MIN_TICK_RATE 100
|
||||
|
||||
/* Saved timex status */
|
||||
static int status;
|
||||
static int sys_status;
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
|
@ -103,16 +103,16 @@ set_leap(int leap, int tai_offset)
|
|||
txc.modes = 0;
|
||||
applied = SYS_Timex_Adjust(&txc, 0) == TIME_WAIT;
|
||||
|
||||
prev_status = status;
|
||||
status &= ~(STA_INS | STA_DEL);
|
||||
prev_status = sys_status;
|
||||
sys_status &= ~(STA_INS | STA_DEL);
|
||||
|
||||
if (leap > 0)
|
||||
status |= STA_INS;
|
||||
sys_status |= STA_INS;
|
||||
else if (leap < 0)
|
||||
status |= STA_DEL;
|
||||
sys_status |= STA_DEL;
|
||||
|
||||
txc.modes = MOD_STATUS;
|
||||
txc.status = status;
|
||||
txc.status = sys_status;
|
||||
|
||||
#ifdef MOD_TAI
|
||||
if (tai_offset && tai_offset != txc.tai) {
|
||||
|
@ -124,7 +124,7 @@ set_leap(int leap, int tai_offset)
|
|||
|
||||
SYS_Timex_Adjust(&txc, 0);
|
||||
|
||||
if (prev_status != status) {
|
||||
if (prev_status != sys_status) {
|
||||
LOG(LOGS_INFO, "System clock status %s leap second",
|
||||
leap ? (leap > 0 ? "set to insert" : "set to delete") :
|
||||
(applied ? "reset after" : "set to not insert/delete"));
|
||||
|
@ -156,12 +156,12 @@ set_sync_status(int synchronised, double est_error, double max_error)
|
|||
#endif
|
||||
|
||||
if (synchronised)
|
||||
status &= ~STA_UNSYNC;
|
||||
sys_status &= ~STA_UNSYNC;
|
||||
else
|
||||
status |= STA_UNSYNC;
|
||||
sys_status |= STA_UNSYNC;
|
||||
|
||||
txc.modes = MOD_STATUS | MOD_ESTERROR | MOD_MAXERROR;
|
||||
txc.status = status;
|
||||
txc.status = sys_status;
|
||||
txc.esterror = est_error * 1.0e6;
|
||||
txc.maxerror = max_error * 1.0e6;
|
||||
|
||||
|
@ -176,17 +176,17 @@ initialise_timex(void)
|
|||
{
|
||||
struct timex txc;
|
||||
|
||||
status = STA_UNSYNC;
|
||||
sys_status = STA_UNSYNC;
|
||||
|
||||
/* Reset PLL offset */
|
||||
txc.modes = MOD_OFFSET | MOD_STATUS;
|
||||
txc.status = STA_PLL | status;
|
||||
txc.status = STA_PLL | sys_status;
|
||||
txc.offset = 0;
|
||||
SYS_Timex_Adjust(&txc, 0);
|
||||
|
||||
/* Turn PLL off */
|
||||
txc.modes = MOD_STATUS;
|
||||
txc.status = status;
|
||||
txc.status = sys_status;
|
||||
SYS_Timex_Adjust(&txc, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue