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 42
42
static uint32_t global_seed = 1 ;
43
43
44
44
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 )
46
46
{
47
47
if (start_value < 2 ) {
48
48
return 0 ;
Original file line number Diff line number Diff line change 17
17
#ifndef CHANNEL_FUNC_H_
18
18
#define CHANNEL_FUNC_H_
19
19
20
+ uint16_t tr51_calc_nearest_prime_number (uint16_t start_value );
21
+
20
22
/**
21
23
* @brief Initialize channel table for TR51 channel function.
22
24
* @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
114
114
{
115
115
// Must allocate channel table for TR51
116
116
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 ) );
118
118
if (!fhss_structure -> ws -> tr51_channel_table ) {
119
119
return -1 ;
120
120
}
You can’t perform that action at this time.
0 commit comments