From db5a21e659fe23ba5722f241b30b1b5382af2528 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Fri, 13 Sep 2019 15:59:33 +0200 Subject: [PATCH] Remove set_master_clock_rate from PHY RF API --- lib/examples/cell_search.c | 3 --- lib/examples/pdsch_enodeb.c | 5 ----- lib/examples/pdsch_ue.c | 8 ------- lib/examples/usrp_capture.c | 7 ------ lib/examples/usrp_capture_sync.c | 7 ------ lib/examples/usrp_txrx.c | 10 ++------- lib/include/srslte/phy/rf/rf.h | 12 ++-------- lib/include/srslte/radio/radio.h | 3 --- lib/src/phy/phch/test/prach_test_usrp.c | 10 --------- lib/src/phy/rf/rf_blade_imp.c | 7 ------ lib/src/phy/rf/rf_blade_imp.h | 8 +------ lib/src/phy/rf/rf_dev.h | 10 --------- lib/src/phy/rf/rf_imp.c | 15 ------------- lib/src/phy/rf/rf_uhd_imp.c | 29 ++++++++++++++++--------- lib/src/phy/rf/rf_utils.c | 1 - lib/src/phy/rf/rf_zmq_imp.c | 10 --------- lib/src/phy/rf/rf_zmq_imp.h | 4 ---- lib/src/phy/sync/test/npss_usrp.c | 7 ------ lib/src/phy/sync/test/nsss_usrp.c | 7 ------ lib/src/phy/sync/test/pss_usrp.c | 7 ------ lib/src/radio/radio.cc | 12 ---------- 21 files changed, 24 insertions(+), 158 deletions(-) diff --git a/lib/examples/cell_search.c b/lib/examples/cell_search.c index 094445f22..1d2a1c481 100644 --- a/lib/examples/cell_search.c +++ b/lib/examples/cell_search.c @@ -164,8 +164,6 @@ int main(int argc, char **argv) { srslte_rf_set_rx_gain(&rf, 50); } - srslte_rf_set_master_clock_rate(&rf, 30.72e6); - // Supress RF messages srslte_rf_suppress_stdout(&rf); @@ -202,7 +200,6 @@ int main(int argc, char **argv) { /* set rf_freq */ srslte_rf_set_rx_freq(&rf, 0, (double)channels[freq].fd * MHZ); - srslte_rf_rx_wait_lo_locked(&rf); INFO("Set rf_freq to %.3f MHz\n", (double) channels[freq].fd * MHZ/1000000); printf( diff --git a/lib/examples/pdsch_enodeb.c b/lib/examples/pdsch_enodeb.c index 5f6a95c92..42e56581d 100644 --- a/lib/examples/pdsch_enodeb.c +++ b/lib/examples/pdsch_enodeb.c @@ -785,11 +785,6 @@ int main(int argc, char **argv) { int srate = srslte_sampling_freq_hz(cell.nof_prb); if (srate != -1) { - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4*srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } printf("Setting sampling rate %.2f MHz\n", (float) srate/1000000); float srate_rf = srslte_rf_set_tx_srate(&rf, (double)srate); if (srate_rf != srate) { diff --git a/lib/examples/pdsch_ue.c b/lib/examples/pdsch_ue.c index c795bceef..d6223ca74 100644 --- a/lib/examples/pdsch_ue.c +++ b/lib/examples/pdsch_ue.c @@ -474,12 +474,9 @@ int main(int argc, char **argv) { sigprocmask(SIG_UNBLOCK, &sigset, NULL); signal(SIGINT, sig_int_handler); - srslte_rf_set_master_clock_rate(&rf, 30.72e6); - /* set receiver frequency */ printf("Tunning receiver to %.3f MHz\n", (prog_args.rf_freq + prog_args.file_offset_freq) / 1000000); srslte_rf_set_rx_freq(&rf, prog_args.rf_nof_rx_ant, prog_args.rf_freq + prog_args.file_offset_freq); - srslte_rf_rx_wait_lo_locked(&rf); uint32_t ntrial = 0; do { @@ -501,11 +498,6 @@ int main(int argc, char **argv) { /* set sampling frequency */ int srate = srslte_sampling_freq_hz(cell.nof_prb); if (srate != -1) { - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4 * srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } printf("Setting sampling rate %.2f MHz\n", (float)srate / 1000000); float srate_rf = srslte_rf_set_rx_srate(&rf, (double) srate); if (srate_rf != srate) { diff --git a/lib/examples/usrp_capture.c b/lib/examples/usrp_capture.c index 1fba5b075..38d79fd69 100644 --- a/lib/examples/usrp_capture.c +++ b/lib/examples/usrp_capture.c @@ -123,7 +123,6 @@ int main(int argc, char **argv) { ERROR("Error opening rf\n"); exit(-1); } - srslte_rf_set_master_clock_rate(&rf, 30.72e6); sigset_t sigset; sigemptyset(&sigset); @@ -134,11 +133,6 @@ int main(int argc, char **argv) { printf("Set RX gain: %.2f dB\n", srslte_rf_set_rx_gain(&rf, rf_gain)); float srate = srslte_rf_set_rx_srate(&rf, rf_rate); if (srate != rf_rate) { - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4*rf_rate); - } else { - srslte_rf_set_master_clock_rate(&rf, rf_rate); - } srate = srslte_rf_set_rx_srate(&rf, rf_rate); if (srate != rf_rate) { ERROR("Error setting samplign frequency %.2f MHz\n", rf_rate * 1e-6); @@ -147,7 +141,6 @@ int main(int argc, char **argv) { } printf("Correctly RX rate: %.2f MHz\n", srate*1e-6); - srslte_rf_rx_wait_lo_locked(&rf); srslte_rf_start_rx_stream(&rf, false); diff --git a/lib/examples/usrp_capture_sync.c b/lib/examples/usrp_capture_sync.c index e668119b4..d5edc4ac0 100644 --- a/lib/examples/usrp_capture_sync.c +++ b/lib/examples/usrp_capture_sync.c @@ -122,7 +122,6 @@ int main(int argc, char **argv) { ERROR("Error opening rf\n"); exit(-1); } - srslte_rf_set_master_clock_rate(&rf, 30.72e6); for (int i = 0; i < nof_rx_antennas; i++) { buffer[i] = srslte_vec_malloc(3 * sizeof(cf_t) * SRSLTE_SF_LEN_PRB(100)); @@ -137,11 +136,6 @@ int main(int argc, char **argv) { printf("Set RX gain: %.1f dB\n", srslte_rf_set_rx_gain(&rf, rf_gain)); int srate = srslte_sampling_freq_hz(nof_prb); if (srate != -1) { - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4*srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } printf("Setting sampling rate %.2f MHz\n", (float) srate/1000000); float srate_rf = srslte_rf_set_rx_srate(&rf, (double) srate); if (srate_rf != srate) { @@ -152,7 +146,6 @@ int main(int argc, char **argv) { ERROR("Invalid number of PRB %d\n", nof_prb); exit(-1); } - srslte_rf_rx_wait_lo_locked(&rf); srslte_rf_start_rx_stream(&rf, false); cell.cp = SRSLTE_CP_NORM; diff --git a/lib/examples/usrp_txrx.c b/lib/examples/usrp_txrx.c index cfc3b52dd..3f6800ac9 100644 --- a/lib/examples/usrp_txrx.c +++ b/lib/examples/usrp_txrx.c @@ -136,14 +136,8 @@ int main(int argc, char **argv) { ERROR("Error opening rf\n"); exit(-1); } - srslte_rf_set_master_clock_rate(&rf, 30.72e6); - - int srate = srslte_sampling_freq_hz(nof_prb); - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4*srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } + + int srate = srslte_sampling_freq_hz(nof_prb); srslte_rf_set_rx_srate(&rf, (double) srate); srslte_rf_set_tx_srate(&rf, (double) srate); diff --git a/lib/include/srslte/phy/rf/rf.h b/lib/include/srslte/phy/rf/rf.h index d9d5222d8..260558802 100644 --- a/lib/include/srslte/phy/rf/rf.h +++ b/lib/include/srslte/phy/rf/rf.h @@ -92,17 +92,9 @@ SRSLTE_API void srslte_rf_flush_buffer(srslte_rf_t *h); SRSLTE_API bool srslte_rf_has_rssi(srslte_rf_t *h); -SRSLTE_API float srslte_rf_get_rssi(srslte_rf_t *h); +SRSLTE_API float srslte_rf_get_rssi(srslte_rf_t* h); -SRSLTE_API bool srslte_rf_rx_wait_lo_locked(srslte_rf_t *h); - -SRSLTE_API void srslte_rf_set_master_clock_rate(srslte_rf_t *h, - double rate); - -SRSLTE_API bool srslte_rf_is_master_clock_dynamic(srslte_rf_t *h); - -SRSLTE_API double srslte_rf_set_rx_srate(srslte_rf_t *h, - double freq); +SRSLTE_API double srslte_rf_set_rx_srate(srslte_rf_t* h, double freq); SRSLTE_API double srslte_rf_set_rx_gain(srslte_rf_t *h, double gain); diff --git a/lib/include/srslte/radio/radio.h b/lib/include/srslte/radio/radio.h index d1f59dd37..d154a34a7 100644 --- a/lib/include/srslte/radio/radio.h +++ b/lib/include/srslte/radio/radio.h @@ -49,7 +49,6 @@ class radio { burst_preamble_samples = 0; burst_preamble_time_rounded = 0; - master_clock_rate = 0; cur_tx_srate = 0; tx_adv_sec = 0; tx_adv_nsamples = 0; @@ -100,7 +99,6 @@ class radio { void set_rx_gain(float gain); void set_tx_rx_gain_offset(float offset); double set_rx_gain_th(float gain); - void set_master_clock_rate(double rate); void set_freq_offset(double freq); void set_tx_freq(uint32_t chan, double freq); @@ -139,7 +137,6 @@ class radio { uint32_t burst_preamble_samples; double burst_preamble_time_rounded; // preamble time rounded to sample time cf_t* zeros; - double master_clock_rate; double cur_tx_srate; double tx_adv_sec; // Transmission time advance to compensate for antenna->timestamp delay diff --git a/lib/src/phy/phch/test/prach_test_usrp.c b/lib/src/phy/phch/test/prach_test_usrp.c index 55107a650..fb18def7b 100644 --- a/lib/src/phy/phch/test/prach_test_usrp.c +++ b/lib/src/phy/phch/test/prach_test_usrp.c @@ -173,16 +173,6 @@ int main(int argc, char **argv) { srslte_rf_set_rx_freq(&rf, 0, uhd_freq); srslte_rf_set_tx_freq(&rf, 0, uhd_freq); - if (srate > 1e6 && (srate / 1000) > 0) { - if (30720%(srate/1000) == 0) { - srslte_rf_set_master_clock_rate(&rf, 30.72e6); - } else { - srslte_rf_set_master_clock_rate(&rf, 23.04e6); - } - } else { - printf("Invalid sampling rate %d Hz\n", srate); - exit(-1); - } printf("Setting sampling rate %.2f MHz\n", (float) srate/1000000); float srate_rf = srslte_rf_set_rx_srate(&rf, (double) srate); if (srate_rf != srate) { diff --git a/lib/src/phy/rf/rf_blade_imp.c b/lib/src/phy/rf/rf_blade_imp.c index 6e1b84404..1137e0301 100644 --- a/lib/src/phy/rf/rf_blade_imp.c +++ b/lib/src/phy/rf/rf_blade_imp.c @@ -244,13 +244,6 @@ int rf_blade_close(void *h) return 0; } -void rf_blade_set_master_clock_rate(UNUSED void* h, UNUSED double rate) {} - -bool rf_blade_is_master_clock_dynamic(UNUSED void* h) -{ - return true; -} - double rf_blade_set_rx_srate(void *h, double freq) { uint32_t bw; diff --git a/lib/src/phy/rf/rf_blade_imp.h b/lib/src/phy/rf/rf_blade_imp.h index e3bd48e05..d869f69f7 100644 --- a/lib/src/phy/rf/rf_blade_imp.h +++ b/lib/src/phy/rf/rf_blade_imp.h @@ -49,13 +49,7 @@ SRSLTE_API float rf_blade_get_rssi(void *h); SRSLTE_API bool rf_blade_rx_wait_lo_locked(void *h); -SRSLTE_API void rf_blade_set_master_clock_rate(void *h, - double rate); - -SRSLTE_API bool rf_blade_is_master_clock_dynamic(void *h); - -SRSLTE_API double rf_blade_set_rx_srate(void *h, - double freq); +SRSLTE_API double rf_blade_set_rx_srate(void* h, double freq); SRSLTE_API double rf_blade_set_rx_gain(void *h, double gain); diff --git a/lib/src/phy/rf/rf_dev.h b/lib/src/phy/rf/rf_dev.h index 94a81d663..200cf35b4 100644 --- a/lib/src/phy/rf/rf_dev.h +++ b/lib/src/phy/rf/rf_dev.h @@ -34,8 +34,6 @@ typedef struct { int (*srslte_rf_open)(char *args, void **h); int (*srslte_rf_open_multi)(char *args, void **h, uint32_t nof_channels); int (*srslte_rf_close)(void *h); - void (*srslte_rf_set_master_clock_rate)(void *h, double rate); - bool (*srslte_rf_is_master_clock_dynamic)(void *h); double (*srslte_rf_set_rx_srate)(void *h, double freq); double (*srslte_rf_set_rx_gain)(void *h, double gain); double (*srslte_rf_set_tx_gain)(void *h, double gain); @@ -77,8 +75,6 @@ static rf_dev_t dev_uhd = {"UHD", rf_uhd_open, .srslte_rf_open_multi = rf_uhd_open_multi, rf_uhd_close, - rf_uhd_set_master_clock_rate, - rf_uhd_is_master_clock_dynamic, rf_uhd_set_rx_srate, rf_uhd_set_rx_gain, rf_uhd_set_tx_gain, @@ -114,8 +110,6 @@ static rf_dev_t dev_blade = {"bladeRF", rf_blade_open, .srslte_rf_open_multi = rf_blade_open_multi, rf_blade_close, - rf_blade_set_master_clock_rate, - rf_blade_is_master_clock_dynamic, rf_blade_set_rx_srate, rf_blade_set_rx_gain, rf_blade_set_tx_gain, @@ -150,8 +144,6 @@ static rf_dev_t dev_soapy = {"soapy", rf_soapy_open, rf_soapy_open_multi, rf_soapy_close, - rf_soapy_set_master_clock_rate, - rf_soapy_is_master_clock_dynamic, rf_soapy_set_rx_srate, rf_soapy_set_rx_gain, rf_soapy_set_tx_gain, @@ -188,8 +180,6 @@ static rf_dev_t dev_zmq = {"zmq", rf_zmq_open, .srslte_rf_open_multi = rf_zmq_open_multi, rf_zmq_close, - rf_zmq_set_master_clock_rate, - rf_zmq_is_master_clock_dynamic, rf_zmq_set_rx_srate, rf_zmq_set_rx_gain, rf_zmq_set_tx_gain, diff --git a/lib/src/phy/rf/rf_imp.c b/lib/src/phy/rf/rf_imp.c index d60d9d2b6..eb1d214be 100644 --- a/lib/src/phy/rf/rf_imp.c +++ b/lib/src/phy/rf/rf_imp.c @@ -131,11 +131,6 @@ const char* srslte_rf_name(srslte_rf_t *rf) { return ((rf_dev_t*) rf->dev)->srslte_rf_devname(rf->handler); } -bool srslte_rf_rx_wait_lo_locked(srslte_rf_t *rf) -{ - return ((rf_dev_t*) rf->dev)->srslte_rf_rx_wait_lo_locked(rf->handler); -} - int srslte_rf_start_rx_stream(srslte_rf_t *rf, bool now) { return ((rf_dev_t*) rf->dev)->srslte_rf_start_rx_stream(rf->handler, now); @@ -192,16 +187,6 @@ int srslte_rf_close(srslte_rf_t *rf) return ((rf_dev_t*) rf->dev)->srslte_rf_close(rf->handler); } -void srslte_rf_set_master_clock_rate(srslte_rf_t *rf, double rate) -{ - ((rf_dev_t*) rf->dev)->srslte_rf_set_master_clock_rate(rf->handler, rate); -} - -bool srslte_rf_is_master_clock_dynamic(srslte_rf_t *rf) -{ - return ((rf_dev_t*) rf->dev)->srslte_rf_is_master_clock_dynamic(rf->handler); -} - double srslte_rf_set_rx_srate(srslte_rf_t *rf, double freq) { return ((rf_dev_t*) rf->dev)->srslte_rf_set_rx_srate(rf->handler, freq); diff --git a/lib/src/phy/rf/rf_uhd_imp.c b/lib/src/phy/rf/rf_uhd_imp.c index bd7bc257d..c4c2491bf 100644 --- a/lib/src/phy/rf/rf_uhd_imp.c +++ b/lib/src/phy/rf/rf_uhd_imp.c @@ -670,23 +670,23 @@ int rf_uhd_close(void* h) void rf_uhd_set_master_clock_rate(void* h, double rate) { rf_uhd_handler_t* handler = (rf_uhd_handler_t*)h; - if (fmod(handler->current_master_clock, rate)) { - if (handler->dynamic_rate) { - uhd_usrp_set_master_clock_rate(handler->usrp, rate, 0); - } + if (handler->dynamic_rate && handler->current_master_clock != rate) { + uhd_usrp_set_master_clock_rate(handler->usrp, rate, 0); handler->current_master_clock = rate; } } -bool rf_uhd_is_master_clock_dynamic(void* h) -{ - rf_uhd_handler_t* handler = (rf_uhd_handler_t*)h; - return handler->dynamic_rate; -} - double rf_uhd_set_rx_srate(void* h, double freq) { rf_uhd_handler_t* handler = (rf_uhd_handler_t*)h; + + // Set master clock rate + if (freq < 10e6) { + rf_uhd_set_master_clock_rate(&handler, 4 * freq); + } else { + rf_uhd_set_master_clock_rate(&handler, freq); + } + if (handler->nof_rx_channels > 1) { #ifdef UHD_SUPPORTS_COMMAND_TIME time_t full; @@ -714,6 +714,14 @@ double rf_uhd_set_rx_srate(void* h, double freq) double rf_uhd_set_tx_srate(void* h, double freq) { rf_uhd_handler_t* handler = (rf_uhd_handler_t*)h; + + // Set master clock rate + if (freq < 10e6) { + rf_uhd_set_master_clock_rate(&handler, 4 * freq); + } else { + rf_uhd_set_master_clock_rate(&handler, freq); + } + if (handler->nof_tx_channels > 1) { #ifdef UHD_SUPPORTS_COMMAND_TIME time_t full; @@ -799,6 +807,7 @@ double rf_uhd_set_rx_freq(void* h, uint32_t ch, double freq) uhd_usrp_set_rx_freq(handler->usrp, &tune_request, i, &tune_result); } } + rf_uhd_rx_wait_lo_locked(handler); return freq; } diff --git a/lib/src/phy/rf/rf_utils.c b/lib/src/phy/rf/rf_utils.c index cef343556..550e59697 100644 --- a/lib/src/phy/rf/rf_utils.c +++ b/lib/src/phy/rf/rf_utils.c @@ -53,7 +53,6 @@ int rf_rssi_scan(srslte_rf_t *rf, float *freqs, float *rssi, int nof_bands, doub f = (double) freqs[i]; srslte_rf_set_rx_freq(rf, 0, f); - srslte_rf_rx_wait_lo_locked(rf); usleep(10000); srslte_rf_start_rx_stream(rf, false); diff --git a/lib/src/phy/rf/rf_zmq_imp.c b/lib/src/phy/rf/rf_zmq_imp.c index 216daba81..118896d6b 100644 --- a/lib/src/phy/rf/rf_zmq_imp.c +++ b/lib/src/phy/rf/rf_zmq_imp.c @@ -601,16 +601,6 @@ int rf_zmq_close(void* h) return SRSLTE_SUCCESS; } -void rf_zmq_set_master_clock_rate(void* h, double rate) -{ - // Do nothing -} - -bool rf_zmq_is_master_clock_dynamic(void* h) -{ - return false; -} - void update_rates(rf_zmq_handler_t* handler, double srate) { if (handler) { diff --git a/lib/src/phy/rf/rf_zmq_imp.h b/lib/src/phy/rf/rf_zmq_imp.h index 06f49c28f..ebda16ab5 100644 --- a/lib/src/phy/rf/rf_zmq_imp.h +++ b/lib/src/phy/rf/rf_zmq_imp.h @@ -53,10 +53,6 @@ SRSLTE_API float rf_zmq_get_rssi(void* h); SRSLTE_API bool rf_zmq_rx_wait_lo_locked(void* h); -SRSLTE_API void rf_zmq_set_master_clock_rate(void* h, double rate); - -SRSLTE_API bool rf_zmq_is_master_clock_dynamic(void* h); - SRSLTE_API double rf_zmq_set_rx_srate(void* h, double freq); SRSLTE_API double rf_zmq_set_rx_gain(void* h, double gain); diff --git a/lib/src/phy/sync/test/npss_usrp.c b/lib/src/phy/sync/test/npss_usrp.c index 190b2f687..f7e93cd8a 100644 --- a/lib/src/phy/sync/test/npss_usrp.c +++ b/lib/src/phy/sync/test/npss_usrp.c @@ -177,16 +177,9 @@ int main(int argc, char** argv) exit(-1); } - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4 * srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } - printf("Set RX rate: %.2f MHz\n", srslte_rf_set_rx_srate(&rf, srate) / 1000000); printf("Set RX gain: %.1f dB\n", srslte_rf_set_rx_gain(&rf, rf_gain)); printf("Set RX freq: %.2f MHz\n", srslte_rf_set_rx_freq(&rf, 0, rf_freq) / 1000000); - srslte_rf_rx_wait_lo_locked(&rf); buffer = malloc(sizeof(cf_t) * flen * 2); if (!buffer) { diff --git a/lib/src/phy/sync/test/nsss_usrp.c b/lib/src/phy/sync/test/nsss_usrp.c index 644994fd9..c6f63bea4 100644 --- a/lib/src/phy/sync/test/nsss_usrp.c +++ b/lib/src/phy/sync/test/nsss_usrp.c @@ -137,16 +137,9 @@ int main(int argc, char** argv) exit(-1); } - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4 * srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } - printf("Set RX rate: %.2f MHz\n", srslte_rf_set_rx_srate(&rf, srate) / 1000000); printf("Set RX gain: %.1f dB\n", srslte_rf_set_rx_gain(&rf, rf_gain)); printf("Set RX freq: %.2f MHz\n", srslte_rf_set_rx_freq(&rf, 0, rf_freq) / 1000000); - srslte_rf_rx_wait_lo_locked(&rf); buffer = malloc(sizeof(cf_t) * input_len * 2); if (!buffer) { diff --git a/lib/src/phy/sync/test/pss_usrp.c b/lib/src/phy/sync/test/pss_usrp.c index f86ea9a58..e869bbd94 100644 --- a/lib/src/phy/sync/test/pss_usrp.c +++ b/lib/src/phy/sync/test/pss_usrp.c @@ -157,16 +157,9 @@ int main(int argc, char **argv) { exit(-1); } - if (srate < 10e6) { - srslte_rf_set_master_clock_rate(&rf, 4*srate); - } else { - srslte_rf_set_master_clock_rate(&rf, srate); - } - printf("Set RX rate: %.2f MHz\n", srslte_rf_set_rx_srate(&rf, srate) / 1000000); printf("Set RX gain: %.1f dB\n", srslte_rf_set_rx_gain(&rf, rf_gain)); printf("Set RX freq: %.2f MHz\n", srslte_rf_set_rx_freq(&rf, 0, rf_freq) / 1000000); - srslte_rf_rx_wait_lo_locked(&rf); buffer = malloc(sizeof(cf_t) * flen * 2); if (!buffer) { diff --git a/lib/src/radio/radio.cc b/lib/src/radio/radio.cc index 03cd812e6..af932cda0 100644 --- a/lib/src/radio/radio.cc +++ b/lib/src/radio/radio.cc @@ -279,19 +279,8 @@ double radio::set_rx_gain_th(float gain) return srslte_rf_set_rx_gain_th(&rf_device, gain); } -void radio::set_master_clock_rate(double rate) -{ - if (rate != master_clock_rate) { - srslte_rf_stop_rx_stream(&rf_device); - srslte_rf_set_master_clock_rate(&rf_device, rate); - srslte_rf_start_rx_stream(&rf_device, false); - master_clock_rate = rate; - } -} - void radio::set_rx_srate(double srate) { - set_master_clock_rate(srate); srslte_rf_set_rx_srate(&rf_device, srate); } @@ -332,7 +321,6 @@ float radio::get_rx_gain() void radio::set_tx_srate(double srate) { - set_master_clock_rate(srate); cur_tx_srate = srslte_rf_set_tx_srate(&rf_device, srate); burst_preamble_samples = (uint32_t) (cur_tx_srate * burst_preamble_sec); if (burst_preamble_samples > burst_preamble_max_samples) {