Commit 54ee3b5c authored by Clay's avatar Clay

Fixed bug where samps pointer could be overwritten in the middle of a read causing a crash.

parent c0865be3
......@@ -524,7 +524,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
phich_string[ue->frame_parms.phich_config_common.phich_resource],
ue->frame_parms.nb_antenna_ports_eNB);
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_IRIS)
LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id,
ue->proc.proc_rxtx[0].frame_rx,
......@@ -577,23 +577,27 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
#endif
#ifndef OAI_IRIS
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif
#endif
#endif
#endif
}
else {
#ifndef OAI_IRIS
#ifndef OAI_USRP
#ifndef OAI_BLADERF
#ifndef OAI_LMSSDR
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif
#endif
#endif
#endif
}
......
......@@ -173,9 +173,9 @@ static int trx_iris_read(openair0_device *device, openair0_timestamp *ptimestamp
long long timeNs = 0;
int flags = 0;
int samples_received = 0;
uint32_t **samps = (uint32_t **)buff;
printf("Reading %d samples from Iris...\n", nsamps);
fflush(stdout);
uint32_t *samps[2] = {(uint32_t *)buff[0], (uint32_t *)buff[1]}; //cws: it seems another thread can clobber these, so we need to save them locally.
//printf("Reading %d samples from Iris...\n", nsamps);
//fflush(stdout);
while (samples_received < nsamps)
{
flags = 0;
......
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