diff options
author | Eric Blossom | 2010-01-18 12:23:57 -0800 |
---|---|---|
committer | Eric Blossom | 2010-01-18 12:23:57 -0800 |
commit | b5709abe52928f0b701cd5f5eedefc2c1665123e (patch) | |
tree | 552421ddbb31ff21595ee335c4dd7e9b5615b406 | |
parent | 165f4bc50ee64b36bae8c3c0d87b366da6fddc03 (diff) | |
download | gnuradio-b5709abe52928f0b701cd5f5eedefc2c1665123e.tar.gz gnuradio-b5709abe52928f0b701cd5f5eedefc2c1665123e.tar.bz2 gnuradio-b5709abe52928f0b701cd5f5eedefc2c1665123e.zip |
Remove assert(dac_rate() == 128000000).
Applied patch from Alexander Chemeris <alexander.chemeris@gmail.com>
that allows non 64MHz clocking on USRP1.
-rw-r--r-- | usrp/host/lib/usrp_standard.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/usrp/host/lib/usrp_standard.cc b/usrp/host/lib/usrp_standard.cc index 541dd3f57..fe5afabdb 100644 --- a/usrp/host/lib/usrp_standard.cc +++ b/usrp/host/lib/usrp_standard.cc @@ -1025,29 +1025,33 @@ usrp_standard_tx::set_tx_freq (int channel, double freq) coarse_mod_t cm; double coarse; - assert (dac_rate () == 128000000); + double coarse_freq_1 = dac_rate () / 8; // First coarse frequency + double coarse_freq_2 = dac_rate () / 4; // Second coarse frequency + double coarse_limit_1 = coarse_freq_1 / 2; // Midpoint of [0 , freq1] range + double coarse_limit_2 = (coarse_freq_1 + coarse_freq_2) / 2; // Midpoint of [freq1 , freq2] range + double high_limit = (double)44e6/128e6*dac_rate (); // Highest meaningful frequency - if (freq < -44e6) // too low + if (freq < -high_limit) // too low return false; - else if (freq < -24e6){ // [-44, -24) + else if (freq < -coarse_limit_2){ // For 64MHz: [-44, -24) cm = CM_NEG_FDAC_OVER_4; - coarse = -dac_rate () / 4; + coarse = -coarse_freq_2; } - else if (freq < -8e6){ // [-24, -8) + else if (freq < -coarse_limit_1){ // For 64MHz: [-24, -8) cm = CM_NEG_FDAC_OVER_8; - coarse = -dac_rate () / 8; + coarse = -coarse_freq_1; } - else if (freq < 8e6){ // [-8, 8) + else if (freq < coarse_limit_1){ // For 64MHz: [-8, 8) cm = CM_OFF; coarse = 0; } - else if (freq < 24e6){ // [8, 24) + else if (freq < coarse_limit_2){ // For 64MHz: [8, 24) cm = CM_POS_FDAC_OVER_8; - coarse = dac_rate () / 8; + coarse = coarse_freq_1; } - else if (freq <= 44e6){ // [24, 44] + else if (freq <= high_limit){ // For 64MHz: [24, 44] cm = CM_POS_FDAC_OVER_4; - coarse = dac_rate () / 4; + coarse = coarse_freq_2; } else // too high return false; |