Skip to content

Commit 4318f37

Browse files
author
Jarkko Paso
authored
Calculate drift in critical state (ARMmbed#2419)
1 parent 01a1909 commit 4318f37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
980980
if (fhss_structure->ws->fhss_configuration.ws_bc_channel_function == WS_TR51CF) {
981981
fhss_structure->ws->bc_slot %= fhss_structure->number_of_channels;
982982
}
983-
platform_exit_critical();
984983
//TODO: support multiple parents
985984
fhss_structure->ws->parent_bc_info = bc_timing_info;
986985
if (prev_synchronization_time && fhss_structure->ws->fhss_configuration.ws_bc_channel_function != WS_FIXED_CHANNEL) {
@@ -1001,6 +1000,7 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
10011000
}
10021001
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);
10031002
}
1003+
platform_exit_critical();
10041004
fhss_stats_update(fhss_structure, STATS_FHSS_SYNCH_INTERVAL, US_TO_S(time_since_last_synch_us));
10051005
return 0;
10061006
}

0 commit comments

Comments
 (0)