Skip to content

Commit a1bfed4

Browse files
author
Jarkko Paso
authored
Added typecast when computing max_timout from drift (ARMmbed#2428)
1 parent 089fb3b commit a1bfed4

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
@@ -419,7 +419,7 @@ static uint32_t fhss_ws_calculate_ufsi(fhss_structure_t *fhss_structure, uint32_
419419
cur_slot--;
420420
uint32_t remaining_time_ms = 0;
421421
if (fhss_structure->ws->unicast_timer_running == true) {
422-
remaining_time_ms = US_TO_MS(get_remaining_slots_us(fhss_structure, fhss_unicast_handler, MS_TO_US(dwell_time) - NS_TO_US(dwell_time * fhss_structure->ws->drift_per_millisecond_ns)));
422+
remaining_time_ms = US_TO_MS(get_remaining_slots_us(fhss_structure, fhss_unicast_handler, MS_TO_US(dwell_time) - NS_TO_US((int64_t)(fhss_structure->ws->drift_per_millisecond_ns * dwell_time))));
423423
}
424424
uint32_t time_to_tx = 0;
425425
uint32_t cur_time = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api);

0 commit comments

Comments
 (0)