Skip to content

Commit 9fcf718

Browse files
author
Jarkko Paso
authored
Updated FHSS optimal packet length to 300 bytes (#2282)
* Check if TX slot setting is too high and use default instead * Fixed warning caused by debug trace
1 parent 427743f commit 9fcf718

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ static void fhss_set_txrx_slot_length(fhss_structure_t *fhss_structure)
199199
uint32_t datarate = fhss_structure->callbacks.read_datarate(fhss_structure->fhss_api);
200200
if (datarate) {
201201
txrx_slot_length_ms_tmp = ((OPTIMAL_PACKET_LENGTH * 2) * (8000000 / datarate)) / 1000;
202+
// Do not allow using too high TX slot length.
203+
if (txrx_slot_length_ms_tmp > WS_TXRX_SLOT_LEN_MS) {
204+
tr_debug("TX slot length setting too high %"PRIu32"ms, using %"PRIu32"ms", txrx_slot_length_ms_tmp, (uint32_t)WS_TXRX_SLOT_LEN_MS);
205+
txrx_slot_length_ms_tmp = WS_TXRX_SLOT_LEN_MS;
206+
}
202207
}
203208
}
204209
uint32_t number_of_tx_slots = ((fhss_structure->ws->fhss_configuration.fhss_broadcast_interval - fhss_structure->ws->fhss_configuration.fhss_bc_dwell_interval) / txrx_slot_length_ms_tmp) / 2;

0 commit comments

Comments
 (0)