diff options
author | Jon Szymaniak <jon.szymaniak@gmail.com> | 2015-03-24 11:52:45 -0400 |
---|---|---|
committer | Jon Szymaniak <jon.szymaniak@gmail.com> | 2015-03-24 12:05:00 -0400 |
commit | 816eb840fd86000b12525ff28d128fe643a15a73 (patch) | |
tree | bc1406d2bce089cf452427dc224f1e44a8d5525f /gr-analog/lib/pwr_squelch_cc_impl.cc | |
parent | 0b8122391963e423ca4b291a49431ffc401cafd1 (diff) |
analog: Wrapped squelch blocks' setter methods with lock
The setter methods of squelch_base and its children have been updated to
hold d_setlock to avoid races.
For example, updating the CTCSS frequency parameter requires
updates to three separate fft::goertzel objects, which are used during
the general_work().
Diffstat (limited to 'gr-analog/lib/pwr_squelch_cc_impl.cc')
-rw-r--r-- | gr-analog/lib/pwr_squelch_cc_impl.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gr-analog/lib/pwr_squelch_cc_impl.cc b/gr-analog/lib/pwr_squelch_cc_impl.cc index 1a414ed464..62b9cff5c6 100644 --- a/gr-analog/lib/pwr_squelch_cc_impl.cc +++ b/gr-analog/lib/pwr_squelch_cc_impl.cc @@ -69,5 +69,19 @@ namespace gr { d_pwr = d_iir.filter(in.real()*in.real()+in.imag()*in.imag()); } + void + pwr_squelch_cc_impl::set_threshold(double db) + { + gr::thread::scoped_lock l(d_setlock); + d_threshold = std::pow(10.0, db/10); + } + + void + pwr_squelch_cc_impl::set_alpha(double alpha) + { + gr::thread::scoped_lock l(d_setlock); + d_iir.set_taps(alpha); + } + } /* namespace analog */ } /* namespace gr */ |