Skip to content

Commit 4489dda

Browse files
author
Jarkko Paso
authored
Merge pull request #2060 from ARMmbed/IOTTHD-3426_traces
FHSS WS: Added temporary debug traces
2 parents b1484d8 + 0306276 commit 4489dda

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,12 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
861861
fhss_structure->ws->drift_per_millisecond_ns += drift_per_ms_tmp;
862862
}
863863
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);
864+
// Temporary debug traces (IOTTHD-3426)
865+
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);
866+
if ((drift_tmp > 5) || (drift_tmp < -5)) {
867+
tr_debug("High drift");
868+
}
869+
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);
864870
}
865871
return 0;
866872
}

0 commit comments

Comments
 (0)