diff --git a/srsenb/src/phy/nr/slot_worker.cc b/srsenb/src/phy/nr/slot_worker.cc index fd67f4537..8bfc578be 100644 --- a/srsenb/src/phy/nr/slot_worker.cc +++ b/srsenb/src/phy/nr/slot_worker.cc @@ -14,11 +14,12 @@ #include "srsran/common/buffer_pool.h" #include "srsran/common/common.h" -#define DEBUG_WRITE_FILE +//#define DEBUG_WRITE_FILE #ifdef DEBUG_WRITE_FILE FILE* f; static uint32_t num_slots = 0; +static uint32_t slots_to_dump = 10; #endif namespace srsenb { @@ -422,15 +423,13 @@ void slot_worker::work_imp() common.worker_end(context, true, tx_rf_buffer); #ifdef DEBUG_WRITE_FILE - fwrite(tx_rf_buffer.get(0), tx_rf_buffer.get_nof_samples() * sizeof(cf_t), 1, f); -#endif - -#ifdef DEBUG_WRITE_FILE - if (num_slots == 30) { + if (num_slots++ < slots_to_dump) { + printf("Writing slot %d\n", dl_slot_cfg.idx); + fwrite(tx_rf_buffer.get(0), tx_rf_buffer.get_nof_samples() * sizeof(cf_t), 1, f); + } else if (num_slots == slots_to_dump) { + printf("Baseband signaled dump finished. Please close app.\n"); fclose(f); - exit(-1); } - num_slots++; #endif }