@@ -811,22 +811,16 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
811
811
return -1 ;
812
812
}
813
813
if (!bc_timing_info -> broadcast_interval || !bc_timing_info -> broadcast_dwell_interval ) {
814
- //IOTTHD-3571 temporary debug traces
815
- tr_debug ("No bc info to synch" );
816
814
return -1 ;
817
815
}
818
816
if (((uint32_t )S_TO_US (fhss_structure -> ws -> min_synch_interval ) > (fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api ) - fhss_structure -> ws -> synchronization_time )) && !force_synch ) {
819
- //IOTTHD-3571 temporary debug traces
820
- tr_debug ("Do not synch, min_synch_interval: %u, timestamp: %" PRIu32 ", synchronization_time: %" PRIu32 "" , fhss_structure -> ws -> min_synch_interval , fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api ), fhss_structure -> ws -> synchronization_time );
821
817
return 0 ;
822
818
}
823
819
platform_enter_critical ();
824
820
uint16_t own_bc_slot = fhss_structure -> ws -> bc_slot ;
825
821
uint32_t prev_synchronization_time = fhss_structure -> ws -> synchronization_time ;
826
822
fhss_structure -> ws -> synchronization_time = fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api );
827
823
uint32_t time_since_last_synch_us = fhss_structure -> ws -> synchronization_time - prev_synchronization_time ;
828
- //IOTTHD-3571 temporary debug traces
829
- tr_debug ("time_since_last_synch_us: %" PRIu32 ", synchronization_time: %" PRIu32 ", prev_synchronization_time: %" PRIu32 "" , time_since_last_synch_us , fhss_structure -> ws -> synchronization_time , prev_synchronization_time );
830
824
uint32_t own_bc_interval_offset = fhss_ws_calculate_broadcast_interval_offset (fhss_structure , fhss_structure -> ws -> synchronization_time );
831
825
fhss_stop_timer (fhss_structure , fhss_broadcast_handler );
832
826
uint32_t time_from_reception_ms = US_TO_MS (fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api ) - bc_timing_info -> bt_rx_timestamp );
@@ -870,9 +864,6 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
870
864
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 )));
871
865
}
872
866
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 );
873
- } else {
874
- //IOTTHD-3571 temporary debug traces
875
- tr_debug ("Do not compensate" );
876
867
}
877
868
fhss_stats_update (fhss_structure , STATS_FHSS_SYNCH_INTERVAL , US_TO_S (time_since_last_synch_us ));
878
869
return 0 ;
0 commit comments