Skip to content

Commit

Permalink
Disable fhss compensation at parent selection if fixed channel mode i…
Browse files Browse the repository at this point in the history
…s enabled for broadcast.

Change-Id: I33afd2ce069c932f5f477f11f8450cd6515e5a08
  • Loading branch information
Juha Heiskanen committed Mar 25, 2019
1 parent 2417093 commit f4e9a1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,8 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
platform_exit_critical();
//TODO: support multiple parents
fhss_structure->ws->parent_bc_info = bc_timing_info;
if (prev_synchronization_time) {
if (prev_synchronization_time && fhss_structure->ws->fhss_configuration.ws_bc_channel_function != WS_FIXED_CHANNEL) {
//TODO: Compensation for fixed channel configuration
if (SYNCH_COMPENSATION_MIN_INTERVAL <= US_TO_S(time_since_last_synch_us)) {
// Update clock drift
fhss_structure->ws->drift_per_millisecond_ns += divide_integer(MS_TO_NS((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_MS(time_since_last_synch_us));
Expand Down

0 comments on commit f4e9a1b

Please sign in to comment.