File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Expand file tree Collapse file tree 3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 4242static uint32_t global_seed = 1 ;
4343
4444
45- static uint16_t tr51_calc_nearest_prime_number (uint16_t start_value )
45+ uint16_t tr51_calc_nearest_prime_number (uint16_t start_value )
4646{
4747 if (start_value < 2 ) {
4848 return 0 ;
Original file line number Diff line number Diff line change 1717#ifndef CHANNEL_FUNC_H_
1818#define CHANNEL_FUNC_H_
1919
20+ uint16_t tr51_calc_nearest_prime_number (uint16_t start_value );
21+
2022/**
2123 * @brief Initialize channel table for TR51 channel function.
2224 * @param channel_table Channel table to be initialized.
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ static int fhss_ws_manage_channel_table_allocation(fhss_structure_t *fhss_struct
114114{
115115 // Must allocate channel table for TR51
116116 if (!fhss_structure -> ws -> tr51_channel_table && !fhss_structure -> ws -> tr51_output_table ) {
117- fhss_structure -> ws -> tr51_channel_table = ns_dyn_mem_alloc (sizeof (int16_t )* channel_count );
117+ fhss_structure -> ws -> tr51_channel_table = ns_dyn_mem_alloc (sizeof (int16_t )* tr51_calc_nearest_prime_number ( channel_count ) );
118118 if (!fhss_structure -> ws -> tr51_channel_table ) {
119119 return -1 ;
120120 }
You can’t perform that action at this time.
0 commit comments