Commit 6bb478ae authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

commiting changes from guitry

parent 7ca47603
......@@ -254,11 +254,11 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
printf("[BRF] set RX sample rate to %u, %u\n", (unsigned int) openair0_cfg[card].sample_rate, actual_value);
if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_bw, &actual_value)) != 0){
if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, 2*(unsigned int) openair0_cfg[card].rx_bw, &actual_value)) != 0){
fprintf(stderr,"Failed to set RX bandwidth: %s\n", bladerf_strerror(status));
brf_error(status);
}else
printf("[BRF] set RX bandwidth to %u, %u\n",(unsigned int)openair0_cfg[card].rx_bw, actual_value);
printf("[BRF] set RX bandwidth to %u, %u\n",2*(unsigned int)openair0_cfg[card].rx_bw, actual_value);
if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg[card].rx_gain[0])) != 0) {
fprintf(stderr,"Failed to set RX gain: %s\n",bladerf_strerror(status));
......@@ -280,11 +280,11 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
}else
printf("[BRF] set TX sampling rate to %u \n", (unsigned int) openair0_cfg[card].sample_rate);
if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg[card].tx_bw, NULL)) != 0){
if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,2*(unsigned int)openair0_cfg[card].tx_bw, NULL)) != 0){
fprintf(stderr, "Failed to set TX bandwidth: %s\n", bladerf_strerror(status));
brf_error(status);
}else
printf("[BRF] set TX bandwidth to %u \n", (unsigned int) openair0_cfg[card].tx_bw);
printf("[BRF] set TX bandwidth to %u \n", 2*(unsigned int) openair0_cfg[card].tx_bw);
if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int) openair0_cfg[card].tx_gain[0])) != 0) {
fprintf(stderr,"Failed to set TX gain: %s\n",bladerf_strerror(status));
......@@ -327,7 +327,7 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
printf("[BRF] RX module enabled \n");
// calibrate
/*
if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_TX)) != 0) {
fprintf(stderr,"Failed to calibrate TX DC: %s\n", bladerf_strerror(status));
brf_error(status);
......@@ -339,7 +339,7 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
brf_error(status);
}else
printf("[BRF] RX module calibrated DC \n");
*/
bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg[card].log_level));
......
......@@ -950,7 +950,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
#ifdef EXMIMO
((short*)dummy_tx_b)[2*i]<<4;
#elif OAI_BLADRF
#elif OAI_BLADERF
((short*)dummy_tx_b)[2*i];
#else
((short*)dummy_tx_b)[2*i]<<4;
......@@ -958,7 +958,7 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]=
#ifdef EXMIMO
((short*)dummy_tx_b)[2*i+1]<<4;
#elif OAI_BLADRF
#elif OAI_BLADERF
((short*)dummy_tx_b)[2*i+1];
#else
((short*)dummy_tx_b)[2*i+1]<<4;
......@@ -997,6 +997,7 @@ static void* eNB_thread_tx( void* param )
eNB_proc_t *proc = (eNB_proc_t*)param;
FILE *tx_time_file;
char tx_time_name[101];
if (opp_enabled == 1) {
snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf_%d", "eNB", proc->subframe);
tx_time_file = fopen(tx_time_name,"w");
......@@ -1136,7 +1137,20 @@ static void* eNB_thread_tx( void* param )
}
do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] );
/*
short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->lte_eNB_common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti];
int i;
for (i=0;i<7680*2;i+=8) {
txdata[i] = 2047;
txdata[i+1] = 0;
txdata[i+2] = 0;
txdata[i+3] = 2047;
txdata[i+4] = -2047;
txdata[i+5] = 0;
txdata[i+6] = 0;
txdata[i+7] = -2047;
}
*/
if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc %d\n", proc->subframe );
exit_fun("nothing to add");
......
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