@@ -121,13 +121,13 @@ static void etx_cache_entry_init(uint8_t attribute_index)
121
121
storage -> sample_count = 0 ;
122
122
}
123
123
124
- static bool etx_update_possible (etx_sample_storage_t * storage , etx_storage_t * entry , uint8_t time )
124
+ static bool etx_update_possible (etx_sample_storage_t * storage , etx_storage_t * entry , uint16_t time_update )
125
125
{
126
- if (storage -> etx_timer && time ) {
127
- if (time >= storage -> etx_timer ) {
126
+ if (storage -> etx_timer && time_update ) {
127
+ if (time_update >= storage -> etx_timer ) {
128
128
storage -> etx_timer = 0 ;
129
129
} else {
130
- storage -> etx_timer -= time ;
130
+ storage -> etx_timer -= time_update ;
131
131
}
132
132
}
133
133
@@ -797,19 +797,12 @@ void etx_cache_timer(int8_t interface_id, uint16_t seconds_update)
797
797
return ;
798
798
}
799
799
800
- mac_neighbor_table_t * table_class = mac_neighbor_info (interface );
801
- if (!table_class ) {
802
- return ;
803
- }
804
800
805
- uint8_t update_seconds ;
806
- if (seconds_update > 255 ) {
807
- update_seconds = 255 ;
808
- } else {
809
- update_seconds = seconds_update ;
801
+ if (!mac_neighbor_info (interface )) {
802
+ return ;
810
803
}
811
804
812
- ns_list_foreach (mac_neighbor_table_entry_t , neighbour , & table_class -> neighbour_list ) {
805
+ ns_list_foreach (mac_neighbor_table_entry_t , neighbour , & mac_neighbor_info ( interface ) -> neighbour_list ) {
813
806
814
807
etx_storage_t * etx_entry = etx_storage_entry_get (interface_id , neighbour -> index );
815
808
@@ -818,7 +811,7 @@ void etx_cache_timer(int8_t interface_id, uint16_t seconds_update)
818
811
}
819
812
etx_sample_storage_t * storage = etx_info .etx_cache_storage_list + neighbour -> index ;
820
813
821
- if (etx_update_possible (storage , etx_entry , update_seconds )) {
814
+ if (etx_update_possible (storage , etx_entry , seconds_update )) {
822
815
etx_calculation (etx_entry , storage -> attempts_count , storage -> received_acks , neighbour -> index );
823
816
}
824
817
}
0 commit comments