Skip to content

Commit

Permalink
FHSS: Increased min random of tx poll
Browse files Browse the repository at this point in the history
Because of bad synchronization, unicast packet was sent
immediately after broadcast channel when receiver had not yet changed
to unicast.
  • Loading branch information
Jarkko Paso committed Oct 2, 2018
1 parent db6dc6b commit a35b702
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/Service_Libs/fhss/fhss_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay)
// Should return to own (unicast) listening channel after broadcast channel
next_channel = fhss_structure->rx_channel;
/* Start timer with random timeout to trigger unicast TX queue poll event.
* Min random is 50us.
* Min random is 1/30 of the TX slot length.
* Max random is 1/10 of the TX slot length.
* Event timer resolution is 50us.
*/
uint32_t txrx_slot_length_us = fhss_structure->ws->txrx_slot_length_ms * 1000;
uint16_t uc_min_random = 1;
uint16_t uc_min_random = (txrx_slot_length_us / 30) / 50;
uint16_t uc_max_random = (txrx_slot_length_us / 10) / 50;
bool tx_allowed = fhss_ws_check_tx_allowed(fhss_structure);
if (!tx_allowed) {
Expand Down

0 comments on commit a35b702

Please sign in to comment.