slot_worker: disable baseband dump by default and don't exit after finishing

This commit is contained in:
Andre Puschmann 2021-11-12 10:22:08 +01:00
parent dd34f5b274
commit 800933c38e
1 changed files with 7 additions and 8 deletions

View File

@ -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
}