diff options
-rw-r--r-- | gnuradio-runtime/lib/constants.cc.in | 19 | ||||
-rw-r--r-- | gr-digital/lib/msk_timing_recovery_cc_impl.cc | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gnuradio-runtime/lib/constants.cc.in b/gnuradio-runtime/lib/constants.cc.in index 516e2f8798..b368e9dc3f 100644 --- a/gnuradio-runtime/lib/constants.cc.in +++ b/gnuradio-runtime/lib/constants.cc.in @@ -24,6 +24,7 @@ #include <config.h> #endif +#include <stdlib.h> #include <gnuradio/constants.h> namespace gr { @@ -31,18 +32,36 @@ namespace gr { const std::string prefix() { + //Use "GR_PREFIX" environment variable when specified + const char *prefix = getenv("GR_PREFIX"); + if (prefix != NULL) return prefix; + return "@prefix@"; } const std::string sysconfdir() { + //Provide the sysconfdir in terms of prefix() + //when the "GR_PREFIX" environment var is specified. + if (getenv("GR_PREFIX") != NULL) + { + return prefix() + "/@GR_CONF_DIR@"; + } + return "@SYSCONFDIR@"; } const std::string prefsdir() { + //Provide the prefsdir in terms of sysconfdir() + //when the "GR_PREFIX" environment var is specified. + if (getenv("GR_PREFIX") != NULL) + { + return sysconfdir() + "/@CMAKE_PROJECT_NAME@/conf.d"; + } + return "@GR_PREFSDIR@"; } diff --git a/gr-digital/lib/msk_timing_recovery_cc_impl.cc b/gr-digital/lib/msk_timing_recovery_cc_impl.cc index 4b26573870..1473aa88c5 100644 --- a/gr-digital/lib/msk_timing_recovery_cc_impl.cc +++ b/gr-digital/lib/msk_timing_recovery_cc_impl.cc @@ -145,8 +145,16 @@ namespace gr { tags.erase(tags.begin()); goto out; } + if(std::abs(center) >= 1.0f) { + GR_LOG_WARN(d_logger, boost::format("work: ignoring time_est tag " + "(%.2f) outside of (-1, 1)") \ + % center); + tags.erase(tags.begin()); + goto out; + } d_mu = center; iidx = offset; + //we want positive mu, so offset iidx to compensate if(d_mu<0) { d_mu++; iidx--; |