Skip to content

Commit 01a1909

Browse files
author
Jarkko Paso
authored
FHSS WS: Do not use drift compensation with unpredictable linux timer (ARMmbed#2418)
1 parent 62d8586 commit 01a1909

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,10 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
993993
} else if (drift_per_ms_tmp < -MAX_DRIFT_COMPENSATION_STEP) {
994994
drift_per_ms_tmp = -MAX_DRIFT_COMPENSATION_STEP;
995995
}
996+
// Timer drift is unpredictable with linux platform. Do not set drift compensation
997+
#ifndef __linux__
996998
fhss_structure->ws->drift_per_millisecond_ns += drift_per_ms_tmp;
999+
#endif
9971000
fhss_stats_update(fhss_structure, STATS_FHSS_DRIFT_COMP, NS_TO_US((int64_t)(fhss_structure->ws->drift_per_millisecond_ns * bc_timing_info->broadcast_dwell_interval)));
9981001
}
9991002
tr_debug("synch to parent: %s, drift: %"PRIi32"ms in %"PRIu64" seconds, compensation: %"PRIi32"ns per ms", trace_array(eui64, 8), true_bc_interval_offset - own_bc_interval_offset + ((int32_t)(fhss_structure->ws->bc_slot - own_bc_slot) * bc_timing_info->broadcast_interval), US_TO_S(time_since_last_synch_us), fhss_structure->ws->drift_per_millisecond_ns);

0 commit comments

Comments
 (0)