@@ -241,6 +241,9 @@ static uint32_t fhss_ws_calculate_ufsi(fhss_structure_t *fhss_structure, uint32_
241
241
}
242
242
cur_slot -- ;
243
243
uint32_t remaining_time = (fhss_structure -> platform_functions .fhss_get_remaining_slots (fhss_unicast_handler , fhss_structure -> fhss_api ) / 1000 );
244
+ if (remaining_time > dwell_time ) {
245
+ remaining_time = 0 ;
246
+ }
244
247
uint32_t time_to_tx = 0 ;
245
248
uint32_t cur_time = fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api );
246
249
if (cur_time < tx_time ) {
@@ -689,6 +692,9 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
689
692
fhss_stop_timer (fhss_structure , fhss_broadcast_handler );
690
693
uint32_t time_from_reception_ms = divide_integer (fhss_structure -> callbacks .read_timestamp (fhss_structure -> fhss_api ) - bc_timing_info -> bt_rx_timestamp , 1000 );
691
694
uint32_t true_bc_interval_offset = (bc_timing_info -> broadcast_interval_offset + time_from_reception_ms ) % bc_timing_info -> broadcast_interval ;
695
+ if (true_bc_interval_offset >= bc_timing_info -> broadcast_dwell_interval ) {
696
+ fhss_structure -> ws -> is_on_bc_channel = false;
697
+ }
692
698
uint32_t timeout = ((bc_timing_info -> broadcast_interval - true_bc_interval_offset )* 1000 );
693
699
694
700
if (fhss_structure -> ws -> is_on_bc_channel ) {
@@ -726,6 +732,7 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co
726
732
if (channel_count <= 0 ) {
727
733
return -1 ;
728
734
}
735
+ platform_enter_critical ();
729
736
if (fhss_configuration -> ws_uc_channel_function == WS_FIXED_CHANNEL || fhss_configuration -> fhss_uc_dwell_interval == 0 ) {
730
737
fhss_stop_timer (fhss_structure , fhss_unicast_handler );
731
738
fhss_structure -> ws -> unicast_timer_running = false;
@@ -739,6 +746,7 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co
739
746
if (fhss_configuration -> ws_uc_channel_function == WS_FIXED_CHANNEL ) {
740
747
fhss_structure -> rx_channel = fhss_configuration -> unicast_fixed_channel ;
741
748
}
749
+ platform_exit_critical ();
742
750
tr_info ("fhss Configuration set, UC channel: %d, BC channel: %d, UC CF: %d, BC CF: %d, channels: %d, uc dwell: %d, bc dwell: %d, bc interval: %d, bsi:%d" ,
743
751
fhss_structure -> ws -> fhss_configuration .unicast_fixed_channel ,
744
752
fhss_structure -> ws -> fhss_configuration .broadcast_fixed_channel ,
0 commit comments