Skip to content

Commit 2188fd2

Browse files
author
Jarkko Paso
committed
FHSS: Fixed negative remaining time in ufsi calculation
1 parent 6679db4 commit 2188fd2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ static uint32_t fhss_ws_calculate_ufsi(fhss_structure_t *fhss_structure, uint32_
241241
}
242242
cur_slot--;
243243
uint32_t remaining_time = (fhss_structure->platform_functions.fhss_get_remaining_slots(fhss_unicast_handler, fhss_structure->fhss_api) / 1000);
244+
if (remaining_time > dwell_time) {
245+
remaining_time = 0;
246+
}
244247
uint32_t time_to_tx = 0;
245248
uint32_t cur_time = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api);
246249
if (cur_time < tx_time) {

0 commit comments

Comments
 (0)