fixed get band in phy_common

master
Ismael Gomez 8 years ago
parent 4c3e64d224
commit a21536a60e

@ -431,14 +431,9 @@ float get_fd(struct lte_band *band, uint32_t earfcn) {
} }
int srslte_band_get_band(uint32_t earfcn) { int srslte_band_get_band(uint32_t earfcn) {
uint32_t i; uint32_t i = SRSLTE_NOF_LTE_BANDS-1;
i=0; while(i > 0 && lte_bands[i].earfcn_offset>earfcn) {
while(i < SRSLTE_NOF_LTE_BANDS && lte_bands[i].earfcn_offset<earfcn) { i--;
i++;
}
if (i == SRSLTE_NOF_LTE_BANDS) {
fprintf(stderr, "Error: EARFCN %d not found\n", earfcn);
return -1;
} }
return lte_bands[i].band; return lte_bands[i].band;
} }

Loading…
Cancel
Save