Commit 1328aca7 authored by Raymond Knopp's avatar Raymond Knopp

fixed compilation issues with UHD

parent 1396d22d
...@@ -405,27 +405,27 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ ...@@ -405,27 +405,27 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
openair0_cfg[0].rx_gain_calib_table = calib_table_x310; openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
switch (openair0_cfg[0].sample_rate) { switch ((int)openair0_cfg[0].sample_rate) {
case 30.72e6: case 30720000:
// from usrp_time_offset // from usrp_time_offset
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15; openair0_cfg[0].tx_sample_advance = 15;
openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
break; break;
case 15.36e6: case 15360000:
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 45; openair0_cfg[0].tx_sample_advance = 45;
openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
break; break;
case 7.6e6: case 7680000:
openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 50; openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
break; break;
case 1.92e6: case 1920000:
openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].samples_per_packet = 256;
openair0_cfg[0].tx_sample_advance = 50; openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
break; break;
default: default:
printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
...@@ -445,32 +445,32 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_ ...@@ -445,32 +445,32 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
// s->usrp->set_clock_source("internal"); // s->usrp->set_clock_source("internal");
// set master clock rate and sample rate for tx & rx for streaming // set master clock rate and sample rate for tx & rx for streaming
device->type = USRP_B200_IF device->type = USRP_B200_IF;
s->usrp->set_master_clock_rate(30.72e6); s->usrp->set_master_clock_rate(30.72e6);
openair0_cfg[0].rx_gain_calib_table = calib_table_b210; openair0_cfg[0].rx_gain_calib_table = calib_table_b210;
switch (openair0_cfg[0].sample_rate) { switch ((int)openair0_cfg[0].sample_rate) {
case 30.72e6: case 30720000:
// from usrp_time_offset // from usrp_time_offset
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 175; openair0_cfg[0].tx_sample_advance = 175;
openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
break; break;
case 15.36e6: case 15360000:
openair0_cfg[0].samples_per_packet = 2048; openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 95; openair0_cfg[0].tx_sample_advance = 95;
openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
break; break;
case 7.6e6: case 7680000:
openair0_cfg[0].samples_per_packet = 1024; openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 70; openair0_cfg[0].tx_sample_advance = 70;
openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
break; break;
case 1.92e6: case 1920000:
openair0_cfg[0].samples_per_packet = 256; openair0_cfg[0].samples_per_packet = 256;
openair0_cfg[0].tx_sample_advance = 40; openair0_cfg[0].tx_sample_advance = 40;
openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[card].samples_per_packet; openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
break; break;
default: default:
printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate); printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
......
...@@ -1632,7 +1632,6 @@ static void* eNB_thread( void* arg ) ...@@ -1632,7 +1632,6 @@ static void* eNB_thread( void* arg )
#ifndef EXMIMO #ifndef EXMIMO
spp = openair0_cfg[0].samples_per_packet; spp = openair0_cfg[0].samples_per_packet;
tx_pos = openair0_cfg[0].tx_scheduling_advance; tx_pos = openair0_cfg[0].tx_scheduling_advance;
tx_advance = openair0_cfg[0].tx_sample_advance;
#endif #endif
while (!oai_exit) { while (!oai_exit) {
......
...@@ -1003,7 +1003,7 @@ void *UE_thread(void *arg) ...@@ -1003,7 +1003,7 @@ void *UE_thread(void *arg)
static int UE_thread_retval; static int UE_thread_retval;
PHY_VARS_UE *UE = PHY_vars_UE_g[0][0]; PHY_VARS_UE *UE = PHY_vars_UE_g[0][0];
int spp = openair0_cfg[0].samples_per_packet; int spp = openair0_cfg[0].samples_per_packet;
int slot=1, frame=0, hw_subframe=0, rxpos=0, txpos=spp*openair0_cfg[0].tx_delay; int slot=1, frame=0, hw_subframe=0, rxpos=0, txpos=spp*openair0_cfg[0].tx_scheduling_advance;
#ifdef __AVX2__ #ifdef __AVX2__
int dummy[2][spp] __attribute__((aligned(32))); int dummy[2][spp] __attribute__((aligned(32)));
#else #else
...@@ -1128,7 +1128,7 @@ void *UE_thread(void *arg) ...@@ -1128,7 +1128,7 @@ void *UE_thread(void *arg)
txp[i] = (void*)&txdata[i][txpos]; txp[i] = (void*)&txdata[i][txpos];
openair0.trx_write_func(&openair0, openair0.trx_write_func(&openair0,
(timestamp+spp*openair0_cfg[0].tx_delay-openair0_cfg[0].tx_forward_nsamps), (timestamp+spp*openair0_cfg[0].tx_scheduling_advance-openair0_cfg[0].tx_sample_advance),
txp, txp,
spp - ((first_rx==1) ? rx_off_diff : 0), spp - ((first_rx==1) ? rx_off_diff : 0),
UE->lte_frame_parms.nb_antennas_tx, UE->lte_frame_parms.nb_antennas_tx,
......
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