[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/01: digital: pfb_clock_sync throws when
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/01: digital: pfb_clock_sync throws when no taps are provided (instead of segfaulting). |
Date: |
Mon, 21 Apr 2014 15:00:43 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch maint
in repository gnuradio.
commit 7ce93ff2060cbf8d7a0dfb6fbc0db8e241900048
Author: Tom Rondeau <address@hidden>
Date: Mon Apr 21 09:10:01 2014 -0400
digital: pfb_clock_sync throws when no taps are provided (instead of
segfaulting).
---
gr-digital/lib/pfb_clock_sync_ccf_impl.cc | 7 +++++--
gr-digital/lib/pfb_clock_sync_fff_impl.cc | 5 ++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
index 995b1cd..60ee02a 100644
--- a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
+++ b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc
@@ -68,6 +68,9 @@ namespace gr {
d_max_dev(max_rate_deviation),
d_osps(osps), d_error(0), d_out_idx(0)
{
+ if(taps.size() == 0)
+ throw std::runtime_error("pfb_clock_sync_ccf: please specify a
filter.\n");
+
// Let scheduler adjust our relative_rate.
enable_update_rate(true);
@@ -421,7 +424,7 @@ namespace gr {
tags.erase(tags.begin());
}
}
-
+
while(d_out_idx < d_osps) {
d_filtnum = (int)floor(d_k);
@@ -498,7 +501,7 @@ namespace gr {
pmt::mp(-2.0f), pmt::mp(2.0f), pmt::mp(0.0f),
"", "Error signal of loop", RPC_PRIVLVL_MIN,
DISPTIME | DISPOPTSTRIP)));
-
+
add_rpc_variable(
rpcbasic_sptr(new rpcbasic_register_get<pfb_clock_sync_ccf, float>(
alias(), "rate",
diff --git a/gr-digital/lib/pfb_clock_sync_fff_impl.cc
b/gr-digital/lib/pfb_clock_sync_fff_impl.cc
index c5a8b6e..2b73aed 100644
--- a/gr-digital/lib/pfb_clock_sync_fff_impl.cc
+++ b/gr-digital/lib/pfb_clock_sync_fff_impl.cc
@@ -65,6 +65,9 @@ namespace gr {
d_max_dev(max_rate_deviation),
d_osps(osps), d_error(0), d_out_idx(0)
{
+ if(taps.size() == 0)
+ throw std::runtime_error("pfb_clock_sync_ccf: please specify a
filter.\n");
+
// Let scheduler adjust our relative_rate.
enable_update_rate(true);
@@ -388,7 +391,7 @@ namespace gr {
while(i < noutput_items) {
while(d_out_idx < d_osps) {
d_filtnum = (int)floor(d_k);
-
+
// Keep the current filter number in [0, d_nfilters]
// If we've run beyond the last filter, wrap around and go to next
sample
// If we've gone below 0, wrap around and go to previous sample