diff --git a/source/Service_Libs/fhss/fhss_ws.c b/source/Service_Libs/fhss/fhss_ws.c index 1aa37f9029c..502260e6b5b 100644 --- a/source/Service_Libs/fhss/fhss_ws.c +++ b/source/Service_Libs/fhss/fhss_ws.c @@ -861,6 +861,12 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8], fhss_structure->ws->drift_per_millisecond_ns += drift_per_ms_tmp; } tr_debug("synch to parent: %s, drift: %"PRIi32"ms in %"PRIu32" 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); + // Temporary debug traces (IOTTHD-3426) + int32_t drift_tmp = true_bc_interval_offset - own_bc_interval_offset + ((int32_t)(fhss_structure->ws->bc_slot - own_bc_slot) * bc_timing_info->broadcast_interval); + if ((drift_tmp > 5) || (drift_tmp < -5)) { + tr_debug("High drift"); + } + tr_debug("%"PRIu32" tr_bc_int_off: %"PRIu32", own_bc_int_off: %"PRIu32", received bc slot: %u, slots since RX: %u, own slot: %u, time from RX: %"PRIu32", prev synch: %"PRIu32", timeout: %"PRIu32", is BC: %i", fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api), true_bc_interval_offset, own_bc_interval_offset, bc_timing_info->broadcast_slot, slots_since_reception, own_bc_slot, time_from_reception_ms, prev_synchronization_time, timeout, fhss_structure->ws->is_on_bc_channel); } return 0; }