fixed coverty bug

master
Ismael Gomez 8 years ago
parent 60e77144ca
commit 2b3087b1f9

@ -173,11 +173,16 @@ int main(int argc, char **argv) {
srslte_rf_set_rx_freq(&rf, uhd_freq); srslte_rf_set_rx_freq(&rf, uhd_freq);
srslte_rf_set_tx_freq(&rf, uhd_freq); srslte_rf_set_tx_freq(&rf, uhd_freq);
if (srate > 1e6) {
if (30720%((int) srate/1000) == 0) { if (30720%((int) srate/1000) == 0) {
srslte_rf_set_master_clock_rate(&rf, 30.72e6); srslte_rf_set_master_clock_rate(&rf, 30.72e6);
} else { } else {
srslte_rf_set_master_clock_rate(&rf, 23.04e6); 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); printf("Setting sampling rate %.2f MHz\n", (float) srate/1000000);
float srate_rf = srslte_rf_set_rx_srate(&rf, (double) srate); float srate_rf = srslte_rf_set_rx_srate(&rf, (double) srate);
if (srate_rf != srate) { if (srate_rf != srate) {

Loading…
Cancel
Save