From a3049674c6494fd3c9cd35623d960d6a91b672f4 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Tue, 26 Mar 2019 10:27:12 +0100 Subject: [PATCH] warning fixed in get_band --- openair1/PHY/INIT/nr_parms.c | 10 +++++----- openair1/PHY/INIT/phy_init.h | 2 +- openair1/SIMULATION/NR_PHY/dlsim.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 095101fb89..bdcf562e6a 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -337,13 +337,14 @@ nr_bandentry_t nr_bandtable[] = { {86, 1710000, 1785000, 000, 000, 20, 342000} }; -int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type) { +void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type) { int ind; int64_t dl_freq_khz = downlink_frequency/1000; for ( ind=0; ind < sizeof(nr_bandtable) / sizeof(nr_bandtable[0]); ind++) { + *current_band = nr_bandtable[ind].band; LOG_I(PHY, "Scanning band %d, dl_min %"PRIu32", ul_min %"PRIu32"\n", ind, nr_bandtable[ind].dl_min,nr_bandtable[ind].ul_min); @@ -360,9 +361,8 @@ int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *cu } } - if( ind == sizeof(nr_bandtable) / sizeof(nr_bandtable[0])) { - LOG_E(PHY,"Can't find EUTRA band for frequency %d\n", downlink_frequency); - return(-1); - } + AssertFatal(ind != (sizeof(nr_bandtable) / sizeof(nr_bandtable[0])), + "Can't find EUTRA band for frequency %d\n", downlink_frequency); + } diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index f500375e4b..bc92d0939e 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -391,7 +391,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB); void init_dfts(void); -int get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); +void get_band(uint32_t downlink_frequency, uint8_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type); /** @} */ diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 652158605b..1416905696 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -154,7 +154,7 @@ int main(int argc, char **argv) int pbch_tx_ant; int N_RB_DL=273,mu=1; - uint64_t ssb_pattern = 0; + uint64_t ssb_pattern = 0x01; unsigned char frame_type = 0; unsigned char pbch_phase = 0;