diff --git a/CMakeLists.txt b/CMakeLists.txt index ca807e35..8c6a6771 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) # Set the version information here set(VERSION_MAJOR 0) set(VERSION_API 3) -set(VERSION_ABI 3) +set(VERSION_ABI 4) set(VERSION_PATCH git) cmake_policy(SET CMP0011 NEW) @@ -111,21 +111,21 @@ ELSE() ENDIF() IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD 23) ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD 23) ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - SET(CMAKE_CXX_STANDARD 17) + SET(CMAKE_CXX_STANDARD 23) ELSE() message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.") ENDIF() IF(CMAKE_C_COMPILER_ID STREQUAL "GNU") - SET(CMAKE_C_STANDARD 17) + SET(CMAKE_C_STANDARD 11) ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") - SET(CMAKE_C_STANDARD 17) + SET(CMAKE_C_STANDARD 11) ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC") - SET(CMAKE_C_STANDARD 17) + SET(CMAKE_C_STANDARD 11) ELSE() message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.") ENDIF() diff --git a/lib/helpers.cc b/lib/helpers.cc index 22ea4765..dba1908b 100644 --- a/lib/helpers.cc +++ b/lib/helpers.cc @@ -42,7 +42,7 @@ double double_mod(double a, long b) { return fmod(fmod(a, b) + b, b); } * @param n_bits The output number of bits * @return std::vector */ -std::vector int2bool(uint integer, uint8_t n_bits) { +std::vector int2bool(uint8_t integer, uint8_t n_bits) { std::vector vec(n_bits, 0); int j = n_bits; for (int i = 0; i < n_bits; i++) { @@ -147,7 +147,7 @@ uint32_t bool2int(std::vector b) { */ void build_ref_chirps(gr_complex *upchirp, gr_complex *downchirp, uint8_t sf) { double N = (1 << sf); - for (uint n = 0; n < N; n++) { + for (uint16_t n = 0; n < N; n++) { // the scaling factor of 0.9 is here to avoid to saturate the USRP_SINK // gr_expj is the phase of the angle of the complex exponential and returns // and real and imag part by gr_sincosf(phase, &t_imag, &t_real); @@ -168,7 +168,7 @@ void build_ref_chirps(gr_complex *upchirp, gr_complex *downchirp, uint8_t sf) { void build_upchirp(gr_complex *chirp, uint32_t id, uint8_t sf) { double N = 1 << sf; // procces all samples - for (uint n = 0; n < N; n++) { + for (uint16_t n = 0; n < N; n++) { // the scaling factor of 0.9 is here to avoid to saturate the USRP_SINK chirp[n] = gr_complex(0.9f, 0.0f) * gr_expj(2.0 * M_PI * (n * n / (2 * N) + (id / N - 0.5) * n)); @@ -178,7 +178,7 @@ void build_upchirp(gr_complex *chirp, uint32_t id, uint8_t sf) { void build_upchirp_os_factor(gr_complex* chirp, uint32_t id, uint8_t sf, uint8_t os_factor = 1){ double N = (1 << sf) ; int n_fold = N* os_factor - id*os_factor; - for(uint n = 0; n < N* os_factor; n++){ + for(uint16_t n = 0; n < N* os_factor; n++){ if(n */ -std::vector int2bool(uint integer, uint8_t n_bits); +std::vector int2bool(uint8_t integer, uint8_t n_bits); /** * @brief Generates a random string of given length @@ -88,20 +88,6 @@ uint32_t get_symbol_val(const gr_complex *samples, gr_complex *ref_chirp, float determine_energy(const gr_complex *samples, uint32_t m_samples_per_symbol); -/** - * @brief return the modulus a%b between 0 and (b-1) - */ -long mod(long a, long b); - -/** - * @brief Convert an integer into a MSB first vector of bool - * - * @param integer : The integer to convert - * @param n_bits : The output number of bits - * @return std::vector - */ -std::vector int2bool(uint integer, uint8_t n_bits); - /** * @brief Convert a MSB first vector of bool to a integer * diff --git a/lib/interleaver_impl.cc b/lib/interleaver_impl.cc index c66d4a77..222eda87 100644 --- a/lib/interleaver_impl.cc +++ b/lib/interleaver_impl.cc @@ -121,7 +121,7 @@ int interleaver_impl::general_work(int noutput_items, // convert to input codewords to binary vector of vector for (int i = 0; i < sf_app; i++) { if (i >= nitems_to_process) // ninput_items[0]) - cw_bin[i] = int2bool(0, cw_len); + cw_bin[i] = int2bool((uint8_t )0, cw_len); else cw_bin[i] = int2bool(in[i], cw_len); cw_cnt++;