Commit d0c5dafd authored by Florian Kaltenberger's avatar Florian Kaltenberger

making recent changes optional by a flag. hopefully this will make regression tests pass.

parent e81b2b28
...@@ -1156,6 +1156,9 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { ...@@ -1156,6 +1156,9 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->num_rb_dl=N_RB; cfg->num_rb_dl=N_RB;
cfg->tx_num_channels=ru->nb_tx; cfg->tx_num_channels=ru->nb_tx;
cfg->rx_num_channels=ru->nb_rx; cfg->rx_num_channels=ru->nb_rx;
cfg->clock_source=get_softmodem_params()->clock_source;
cfg->use_single_antenna_port_for_tdd=1; //TODO: make this parameterzable
for (i=0; i<ru->nb_tx; i++) { for (i=0; i<ru->nb_tx; i++) {
if (ru->if_frequency == 0) { if (ru->if_frequency == 0) {
......
...@@ -236,6 +236,8 @@ typedef struct { ...@@ -236,6 +236,8 @@ typedef struct {
double tx_sample_rate; double tx_sample_rate;
//! check for threequarter sampling rate //! check for threequarter sampling rate
int8_t threequarter_fs; int8_t threequarter_fs;
//! flag to indicate use of same antenna port for RX and TX (for TDD)
int8_t use_single_antenna_port_for_tdd;
} openair0_config_t; } openair0_config_t;
/*! \brief RF mapping */ /*! \brief RF mapping */
......
...@@ -105,8 +105,8 @@ typedef struct { ...@@ -105,8 +105,8 @@ typedef struct {
int64_t rx_count; int64_t rx_count;
int wait_for_first_pps; int wait_for_first_pps;
int use_gps; int use_gps;
int first_tx; //int first_tx;
int first_rx; //int first_rx;
//! timestamp of RX packet //! timestamp of RX packet
openair0_timestamp rx_timestamp; openair0_timestamp rx_timestamp;
uint32_t recplay_mode; uint32_t recplay_mode;
...@@ -288,16 +288,11 @@ static int trx_usrp_start(openair0_device *device) { ...@@ -288,16 +288,11 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1 // set the output pins to 1
s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80); s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80);
//if (s->use_gps == 1 || device->openair0_cfg[0].time_source == external) { s->wait_for_first_pps = 1;
s->wait_for_first_pps = 1;
/*} else {
s->wait_for_first_pps = 0;
}*/
s->rx_count = 0; s->rx_count = 0;
s->tx_count = 0; s->tx_count = 0;
s->first_tx = 1; //s->first_tx = 1;
s->first_rx = 1; //s->first_rx = 1;
s->rx_timestamp = 0; s->rx_timestamp = 0;
...@@ -308,6 +303,16 @@ static int trx_usrp_start(openair0_device *device) { ...@@ -308,6 +303,16 @@ static int trx_usrp_start(openair0_device *device) {
boost::this_thread::sleep(boost::posix_time::milliseconds(1)); boost::this_thread::sleep(boost::posix_time::milliseconds(1));
} }
// init recv and send streaming command
if (device->openair0_cfg->use_single_antenna_port_for_tdd==0) {
uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
cmd.time_spec = uhd::time_spec_t(1.0);
cmd.stream_now = false; // start at constant delay
s->rx_stream->issue_stream_cmd(cmd);
}
// else the issue stream mode command needs to be called every TDD period
return 0; return 0;
} }
/*! \brief Terminate operation of the USRP transceiver -- free all associated resources /*! \brief Terminate operation of the USRP transceiver -- free all associated resources
...@@ -322,15 +327,15 @@ static void trx_usrp_end(openair0_device *device) { ...@@ -322,15 +327,15 @@ static void trx_usrp_end(openair0_device *device) {
if (s == NULL) if (s == NULL)
return; return;
if (s->recplay_mode != RECPLAY_REPLAYMODE) { // not subframes replay if ((s->recplay_mode != RECPLAY_REPLAYMODE) &&
/* (device->openair0_cfg->use_single_antenna_port_for_tdd==0)) {
s->rx_stream->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS); s->rx_stream->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
//send a mini EOB packet //send a mini EOB packet
s->tx_md.end_of_burst = true; s->tx_md.end_of_burst = true;
s->tx_stream->send("", 0, s->tx_md); s->tx_stream->send("", 0, s->tx_md);
s->tx_md.end_of_burst = false; s->tx_md.end_of_burst = false;
sleep(1); sleep(1);
*/
} }
if (s->recplay_mode == RECPLAY_RECORDMODE) { // subframes store if (s->recplay_mode == RECPLAY_RECORDMODE) { // subframes store
...@@ -588,7 +593,7 @@ static int trx_usrp_read_recplay(openair0_device *device, openair0_timestamp *pt ...@@ -588,7 +593,7 @@ static int trx_usrp_read_recplay(openair0_device *device, openair0_timestamp *pt
if (cur_samples == 0) { if (cur_samples == 0) {
std::cerr << "starting subframes file with wrap_count=" << wrap_count << " wrap_ts=" << wrap_ts std::cerr << "starting subframes file with wrap_count=" << wrap_count << " wrap_ts=" << wrap_ts
<< " ts=" << ptimestamp << std::endl; << " ts=" << *ptimestamp << std::endl;
} }
memcpy(buff[0], &s->recplay_state->ms_sample->samples[0], nsamps*4); memcpy(buff[0], &s->recplay_state->ms_sample->samples[0], nsamps*4);
...@@ -1285,12 +1290,14 @@ extern "C" { ...@@ -1285,12 +1290,14 @@ extern "C" {
/* Setting TX/RX BW after streamers are created due to USRP calibration issue */ /* Setting TX/RX BW after streamers are created due to USRP calibration issue */
for(int i=0; i<((int) s->usrp->get_tx_num_channels()) && i<openair0_cfg[0].tx_num_channels; i++) { for(int i=0; i<((int) s->usrp->get_tx_num_channels()) && i<openair0_cfg[0].tx_num_channels; i++) {
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i); s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
s->usrp->set_tx_antenna("TX/RX",i); if (device->openair0_cfg->use_single_antenna_port_for_tdd==1)
s->usrp->set_tx_antenna("TX/RX",i);
} }
for(int i=0; i<((int) s->usrp->get_rx_num_channels()) && i<openair0_cfg[0].rx_num_channels; i++) { for(int i=0; i<((int) s->usrp->get_rx_num_channels()) && i<openair0_cfg[0].rx_num_channels; i++) {
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i); s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
s->usrp->set_rx_antenna("TX/RX",i); if (device->openair0_cfg->use_single_antenna_port_for_tdd==1)
s->usrp->set_rx_antenna("TX/RX",i);
} }
for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) { for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment