diff --git a/lib/src/phy/dft/ofdm.c b/lib/src/phy/dft/ofdm.c index 1acb7c437..8a75a1ad6 100644 --- a/lib/src/phy/dft/ofdm.c +++ b/lib/src/phy/dft/ofdm.c @@ -257,6 +257,8 @@ int srslte_ofdm_rx_init(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* int srslte_ofdm_rx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t max_prb) { + bzero(q, sizeof(srslte_ofdm_t)); + srslte_ofdm_cfg_t cfg = {}; cfg.cp = cp; cfg.in_buffer = in_buffer; @@ -283,16 +285,22 @@ int srslte_ofdm_tx_init(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* int srslte_ofdm_tx_init_cfg(srslte_ofdm_t* q, srslte_ofdm_cfg_t* cfg) { + bzero(q, sizeof(srslte_ofdm_t)); + return ofdm_init_mbsfn_(q, cfg, SRSLTE_DFT_BACKWARD); } int srslte_ofdm_rx_init_cfg(srslte_ofdm_t* q, srslte_ofdm_cfg_t* cfg) { + bzero(q, sizeof(srslte_ofdm_t)); + return ofdm_init_mbsfn_(q, cfg, SRSLTE_DFT_FORWARD); } int srslte_ofdm_tx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t nof_prb) { + bzero(q, sizeof(srslte_ofdm_t)); + srslte_ofdm_cfg_t cfg = {}; cfg.cp = cp; cfg.in_buffer = in_buffer; diff --git a/lib/src/phy/phch/test/pmch_file_test.c b/lib/src/phy/phch/test/pmch_file_test.c index 637e37a1f..b9d22ec04 100644 --- a/lib/src/phy/phch/test/pmch_file_test.c +++ b/lib/src/phy/phch/test/pmch_file_test.c @@ -50,7 +50,7 @@ uint32_t sf_idx = 1; uint8_t non_mbsfn_region = 2; int mbsfn_area_id = 1; -srslte_softbuffer_rx_t softbuffer_rx; +srslte_softbuffer_rx_t softbuffer_rx = {}; srslte_filesource_t fsrc; srslte_ue_dl_t ue_dl; cf_t* input_buffer[SRSLTE_MAX_PORTS]; @@ -80,7 +80,7 @@ void parse_args(int argc, char** argv) cell.id = (uint32_t)strtol(argv[optind], NULL, 10); break; case 's': - sf_idx = (int)strtol(argv[optind], NULL, 10); + sf_idx = (uint32_t)strtol(argv[optind], NULL, 10); break; case 'f': cfi = (uint32_t)strtol(argv[optind], NULL, 10); @@ -151,6 +151,7 @@ void base_free() { srslte_filesource_free(&fsrc); srslte_ue_dl_free(&ue_dl); + srslte_softbuffer_rx_free(&softbuffer_rx); free(input_buffer[0]); }