Skip to content

Commit a56b908

Browse files
author
Jarkko Paso
authored
Merge pull request #2153 from ARMmbed/IOTTHD-3650
fhss_ws: typecast drift to int32_t
2 parents 9b33e98 + b1beb5d commit a56b908

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
@@ -860,7 +860,7 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
860860
//TODO: Compensation for fixed channel configuration
861861
if (SYNCH_COMPENSATION_MIN_INTERVAL <= US_TO_S(time_since_last_synch_us)) {
862862
// Update clock drift
863-
int32_t drift_per_ms_tmp = 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));
863+
int32_t drift_per_ms_tmp = divide_integer((int32_t)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));
864864
if (drift_per_ms_tmp > MAX_DRIFT_COMPENSATION_STEP) {
865865
drift_per_ms_tmp = MAX_DRIFT_COMPENSATION_STEP;
866866
} else if (drift_per_ms_tmp < -MAX_DRIFT_COMPENSATION_STEP) {

0 commit comments

Comments
 (0)