@@ -82,7 +82,7 @@ static void fhss_event_timer_cb(int8_t timer_id, uint16_t slots);
82
82
static void fhss_ws_update_uc_channel_callback (fhss_structure_t * fhss_structure );
83
83
static void fhss_unicast_handler (const fhss_api_t * fhss_api , uint16_t delay );
84
84
static bool fhss_ws_check_tx_allowed (fhss_structure_t * fhss_structure );
85
- static uint8_t fhss_set_txrx_slot_length (fhss_structure_t * fhss_structure );
85
+ static uint32_t fhss_set_txrx_slot_length (fhss_structure_t * fhss_structure );
86
86
87
87
// This function supports rounding up
88
88
static int32_t divide_integer (int32_t dividend , int32_t divisor )
@@ -169,9 +169,9 @@ static int fhss_ws_manage_channel_table_allocation(fhss_structure_t *fhss_struct
169
169
return 0 ;
170
170
}
171
171
172
- static uint8_t fhss_set_txrx_slot_length (fhss_structure_t * fhss_structure )
172
+ static uint32_t fhss_set_txrx_slot_length (fhss_structure_t * fhss_structure )
173
173
{
174
- uint8_t number_of_tx_slots = ((fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) / WS_MAX_TXRX_SLOT_LEN_MS ) / 2 ;
174
+ uint32_t number_of_tx_slots = ((fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) / WS_MAX_TXRX_SLOT_LEN_MS ) / 2 ;
175
175
if (!number_of_tx_slots ) {
176
176
return 0 ;
177
177
}
@@ -519,7 +519,7 @@ static bool fhss_ws_check_tx_allowed(fhss_structure_t *fhss_structure)
519
519
if (fhss_structure -> ws -> is_on_bc_channel == true) {
520
520
return true;
521
521
}
522
- uint8_t number_of_tx_slots = fhss_set_txrx_slot_length (fhss_structure );
522
+ uint32_t number_of_tx_slots = fhss_set_txrx_slot_length (fhss_structure );
523
523
// Allow transmission when broadcast interval is very short comparing to MAX slot length
524
524
if (!number_of_tx_slots ) {
525
525
return true;
@@ -528,7 +528,7 @@ static bool fhss_ws_check_tx_allowed(fhss_structure_t *fhss_structure)
528
528
uint32_t remaining_time_ms = get_remaining_slots_us (fhss_structure , fhss_broadcast_handler , MS_TO_US (fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval )) / 1000 ;
529
529
uint32_t tx_slot_begin = (fhss_structure -> ws -> fhss_configuration .fhss_broadcast_interval - fhss_structure -> ws -> fhss_configuration .fhss_bc_dwell_interval ) - (fhss_structure -> ws -> txrx_slot_length_ms * (fhss_structure -> own_hop & 1 ));
530
530
uint32_t rx_slot_begin = tx_slot_begin - fhss_structure -> ws -> txrx_slot_length_ms ;
531
- uint8_t n_o_tx_slots = number_of_tx_slots ;
531
+ uint32_t n_o_tx_slots = number_of_tx_slots ;
532
532
533
533
while (n_o_tx_slots -- ) {
534
534
if ((remaining_time_ms <= tx_slot_begin ) && (remaining_time_ms > rx_slot_begin )) {
0 commit comments