Skip to content

Commit a35b702

Browse files
author
Jarkko Paso
committed
FHSS: Increased min random of tx poll
Because of bad synchronization, unicast packet was sent immediately after broadcast channel when receiver had not yet changed to unicast.
1 parent db6dc6b commit a35b702

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ static void fhss_broadcast_handler(const fhss_api_t *fhss_api, uint16_t delay)
163163
// Should return to own (unicast) listening channel after broadcast channel
164164
next_channel = fhss_structure->rx_channel;
165165
/* Start timer with random timeout to trigger unicast TX queue poll event.
166-
* Min random is 50us.
166+
* Min random is 1/30 of the TX slot length.
167167
* Max random is 1/10 of the TX slot length.
168168
* Event timer resolution is 50us.
169169
*/
170170
uint32_t txrx_slot_length_us = fhss_structure->ws->txrx_slot_length_ms * 1000;
171-
uint16_t uc_min_random = 1;
171+
uint16_t uc_min_random = (txrx_slot_length_us / 30) / 50;
172172
uint16_t uc_max_random = (txrx_slot_length_us / 10) / 50;
173173
bool tx_allowed = fhss_ws_check_tx_allowed(fhss_structure);
174174
if (!tx_allowed) {

0 commit comments

Comments
 (0)