Revision 40576b23

b/host/lib/usrp/dboard/db_sbx_common.cpp
1 1
//
2
// Copyright 2011 Ettus Research LLC
2
// Copyright 2011-2012 Ettus Research LLC
3 3
//
4 4
// This program is free software: you can redistribute it and/or modify
5 5
// it under the terms of the GNU General Public License as published by
......
213 213
    int tx_pga0_iobits = tx_pga0_gain_to_iobits(_tx_gains["PGA0"]);
214 214
    int rx_lo_lpf_en = (_rx_lo_freq == sbx_enable_rx_lo_filter.clip(_rx_lo_freq)) ? LO_LPF_EN : 0;
215 215
    int tx_lo_lpf_en = (_tx_lo_freq == sbx_enable_tx_lo_filter.clip(_tx_lo_freq)) ? LO_LPF_EN : 0;
216
    int rx_ld_led = get_locked(dboard_iface::UNIT_RX).to_bool() ? 0 : RX_LED_LD;
217
    int tx_ld_led = get_locked(dboard_iface::UNIT_TX).to_bool() ? 0 : TX_LED_LD;
216
    int rx_ld_led = _rx_lo_lock_cache ? 0 : RX_LED_LD;
217
    int tx_ld_led = _tx_lo_lock_cache ? 0 : TX_LED_LD;
218 218
    int rx_ant_led = _rx_ant == "TX/RX" ? RX_LED_RX1RX2 : 0;
219 219
    int tx_ant_led = _tx_ant == "TX/RX" ? 0 : TX_LED_TXRX;
220 220

  
......
283 283
 **********************************************************************/
284 284
double sbx_xcvr::set_lo_freq(dboard_iface::unit_t unit, double target_freq) {
285 285
    const double actual = db_actual->set_lo_freq(unit, target_freq);
286
    if (unit == dboard_iface::UNIT_RX) _rx_lo_freq = actual;
287
    if (unit == dboard_iface::UNIT_TX) _tx_lo_freq = actual;
286
    if (unit == dboard_iface::UNIT_RX){
287
        _rx_lo_lock_cache = false;
288
        _rx_lo_freq = actual;
289
    }
290
    if (unit == dboard_iface::UNIT_TX){
291
        _tx_lo_lock_cache = false;
292
        _tx_lo_freq = actual;
293
    }
288 294
    update_atr();
289 295
    return actual;
290 296
}
......
292 298

  
293 299
sensor_value_t sbx_xcvr::get_locked(dboard_iface::unit_t unit) {
294 300
    const bool locked = (this->get_iface()->read_gpio(unit) & LOCKDET_MASK) != 0;
301

  
302
    if (unit == dboard_iface::UNIT_RX) _rx_lo_lock_cache = locked;
303
    if (unit == dboard_iface::UNIT_TX) _tx_lo_lock_cache = locked;
304

  
305
    //write the new lock cache setting to atr regs
306
    update_atr();
307

  
295 308
    return sensor_value_t("LO", locked, "locked", "unlocked");
296 309
}
297 310

  
b/host/lib/usrp/dboard/db_sbx_common.hpp
1 1
//
2
// Copyright 2011 Ettus Research LLC
2
// Copyright 2011-2012 Ettus Research LLC
3 3
//
4 4
// This program is free software: you can redistribute it and/or modify
5 5
// it under the terms of the GNU General Public License as published by
......
138 138
    uhd::dict<std::string, double> _tx_gains, _rx_gains;
139 139
    double       _rx_lo_freq, _tx_lo_freq;
140 140
    std::string  _tx_ant, _rx_ant;
141
    bool _rx_lo_lock_cache, _tx_lo_lock_cache;
141 142

  
142 143
    void set_rx_ant(const std::string &ant);
143 144
    void set_tx_ant(const std::string &ant);
b/host/lib/usrp/dboard/db_sbx_version3.cpp
1 1
//
2
// Copyright 2011 Ettus Research LLC
2
// Copyright 2011-2012 Ettus Research LLC
3 3
//
4 4
// This program is free software: you can redistribute it and/or modify
5 5
// it under the terms of the GNU General Public License as published by
......
139 139

  
140 140
    UHD_LOGV(often)
141 141
        << boost::format("SBX Intermediates: ref=%0.2f, outdiv=%f, fbdiv=%f") % (ref_freq*(1+int(D))/(R*(1+int(T)))) % double(RFdiv*2) % double(N + double(FRAC)/double(MOD)) << std::endl
142
        << boost::format("SBX tune: R=%d, BS=%d, N=%d, FRAC=%d, MOD=%d, T=%d, D=%d, RFdiv=%d, LD=%s"
143
            ) % R % BS % N % FRAC % MOD % T % D % RFdiv % self_base->get_locked(unit).to_pp_string() << std::endl
142
        << boost::format("SBX tune: R=%d, BS=%d, N=%d, FRAC=%d, MOD=%d, T=%d, D=%d, RFdiv=%d"
143
            ) % R % BS % N % FRAC % MOD % T % D % RFdiv << std::endl
144 144
        << boost::format("SBX Frequencies (MHz): REQ=%0.2f, ACT=%0.2f, VCO=%0.2f, PFD=%0.2f, BAND=%0.2f"
145 145
            ) % (target_freq/1e6) % (actual_freq/1e6) % (vco_freq/1e6) % (pfd_freq/1e6) % (pfd_freq/BS/1e6) << std::endl;
146 146

  
b/host/lib/usrp/dboard/db_sbx_version4.cpp
1 1
//
2
// Copyright 2011 Ettus Research LLC
2
// Copyright 2011-2012 Ettus Research LLC
3 3
//
4 4
// This program is free software: you can redistribute it and/or modify
5 5
// it under the terms of the GNU General Public License as published by
......
142 142

  
143 143
    UHD_LOGV(often)
144 144
        << boost::format("SBX Intermediates: ref=%0.2f, outdiv=%f, fbdiv=%f") % (ref_freq*(1+int(D))/(R*(1+int(T)))) % double(RFdiv*2) % double(N + double(FRAC)/double(MOD)) << std::endl
145
        << boost::format("SBX tune: R=%d, BS=%d, N=%d, FRAC=%d, MOD=%d, T=%d, D=%d, RFdiv=%d, LD=%s"
146
            ) % R % BS % N % FRAC % MOD % T % D % RFdiv % self_base->get_locked(unit).to_pp_string() << std::endl
145
        << boost::format("SBX tune: R=%d, BS=%d, N=%d, FRAC=%d, MOD=%d, T=%d, D=%d, RFdiv=%d"
146
            ) % R % BS % N % FRAC % MOD % T % D % RFdiv << std::endl
147 147
        << boost::format("SBX Frequencies (MHz): REQ=%0.2f, ACT=%0.2f, VCO=%0.2f, PFD=%0.2f, BAND=%0.2f"
148 148
            ) % (target_freq/1e6) % (actual_freq/1e6) % (vco_freq/1e6) % (pfd_freq/1e6) % (pfd_freq/BS/1e6) << std::endl;
149 149

  

Also available in: Unified diff