Removed UHD decimation warnings for 2 antennas

master
Ismael Gomez 7 years ago
parent 54974c5d64
commit 0844274147

@ -290,6 +290,13 @@ int rf_uhd_open(char *args, void **h)
return rf_uhd_open_multi(args, h, 1);
}
static void remove_substring(char *s,const char *toremove)
{
while((s=strstr(s,toremove))) {
memmove(s,s+strlen(toremove),1+strlen(s+strlen(toremove)));
}
}
int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels)
{
if (h) {
@ -325,6 +332,20 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels)
bzero(zero_mem, sizeof(cf_t)*64*1024);
enum {DEFAULT, EXTERNAL, GPSDO} clock_src;
// Set external clock reference
if (strstr(args, "clock=external")) {
remove_substring(args, "clock=external");
clock_src = EXTERNAL;
} else if (strstr(args, "clock=gpsdo")) {
printf("Using GPSDO clock\n");
remove_substring(args, "clock=gpsdo");
clock_src = GPSDO;
} else {
clock_src = DEFAULT;
}
/* If device type or name not given in args, choose a B200 */
if (args[0]=='\0') {
if (find_string(devices_str, "type=b200") && !strstr(args, "recv_frame_size")) {
@ -379,14 +400,12 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels)
}
// Set external clock reference
if (strstr(args, "clock=external")) {
if (clock_src == EXTERNAL) {
uhd_usrp_set_clock_source(handler->usrp, "external", 0);
} else if (strstr(args, "clock=gpsdo")) {
printf("Using GPSDO clock\n");
} else if (clock_src == GPSDO) {
uhd_usrp_set_clock_source(handler->usrp, "gpsdo", 0);
}
handler->has_rssi = get_has_rssi(handler);
if (handler->has_rssi) {
uhd_sensor_value_make_from_realnum(&handler->rssi_value, "rssi", 0, "dBm", "%f");
@ -405,8 +424,10 @@ int rf_uhd_open_multi(char *args, void **h, uint32_t nof_channels)
handler->nof_tx_channels = nof_channels;
/* Set default rate to avoid decimation warnings */
uhd_usrp_set_rx_rate(handler->usrp, 1.92e6, 0);
uhd_usrp_set_tx_rate(handler->usrp, 1.92e6, 0);
for (int i=0;i<nof_channels;i++) {
uhd_usrp_set_rx_rate(handler->usrp, 1.92e6, i);
uhd_usrp_set_tx_rate(handler->usrp, 1.92e6, i);
}
/* Initialize rx and tx stremers */
uhd_rx_streamer_make(&handler->rx_stream);

@ -62,8 +62,12 @@ bool radio::init(char *args, char *devname)
printf("\nWarning burst preamble is not calibrated for device %s. Set a value manually\n\n", srslte_rf_name(&rf_device));
}
if (args) {
strncpy(saved_args, args, 128);
}
if (devname) {
strncpy(saved_devname, devname, 128);
}
return true;
}

@ -30,6 +30,13 @@ bool radio_multi::init_multi(uint32_t nof_rx_antennas, char* args, char* devname
printf("\nWarning burst preamble is not calibrated for device %s. Set a value manually\n\n", srslte_rf_name(&rf_device));
}
if (args) {
strncpy(saved_args, args, 128);
}
if (devname) {
strncpy(saved_devname, devname, 128);
}
return true;
}

Loading…
Cancel
Save