Skip to content

Commit

Permalink
FHSS: Fixed negative remaining time in ufsi calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarkko Paso committed Oct 23, 2018
1 parent 6679db4 commit 2188fd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ static uint32_t fhss_ws_calculate_ufsi(fhss_structure_t *fhss_structure, uint32_
}
cur_slot--;
uint32_t remaining_time = (fhss_structure->platform_functions.fhss_get_remaining_slots(fhss_unicast_handler, fhss_structure->fhss_api) / 1000);
if (remaining_time > dwell_time) {
remaining_time = 0;
}
uint32_t time_to_tx = 0;
uint32_t cur_time = fhss_structure->callbacks.read_timestamp(fhss_structure->fhss_api);
if (cur_time < tx_time) {
Expand Down

0 comments on commit 2188fd2

Please sign in to comment.