From 7f01386f63850d9e13afb4033d1fae39f6a03764 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 4 May 2011 18:36:10 -0700 Subject: uhd: replaced warning post with calls to UHD_MSG(warning) The message api can support warnings, error, and status messages. The default handler is to stdio, but the user can change this. --- host/lib/usrp/multi_usrp.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/multi_usrp.cpp') diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 83cbf339b..2b32602da 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,11 +55,11 @@ static inline void do_samp_rate_warning_message( ){ static const double max_allowed_error = 1.0; //Sps if (std::abs(target_rate - actual_rate) > max_allowed_error){ - uhd::warning::post(str(boost::format( + UHD_MSG(warning) << boost::format( "The hardware does not support the requested %s sample rate:\n" "Target sample rate: %f MSps\n" "Actual sample rate: %f MSps\n" - ) % xx % (target_rate/1e6) % (actual_rate/1e6))); + ) % xx % (target_rate/1e6) % (actual_rate/1e6); } } @@ -70,11 +70,11 @@ static inline void do_tune_freq_warning_message( ){ static const double max_allowed_error = 1.0; //Hz if (std::abs(target_freq - actual_freq) > max_allowed_error){ - uhd::warning::post(str(boost::format( + UHD_MSG(warning) << boost::format( "The hardware does not support the requested %s frequency:\n" "Target frequency: %f MHz\n" "Actual frequency: %f MHz\n" - ) % xx % (target_freq/1e6) % (actual_freq/1e6))); + ) % xx % (target_freq/1e6) % (actual_freq/1e6); } } @@ -211,11 +211,11 @@ public: time_spec_t time_0 = _mboard(0)[MBOARD_PROP_TIME_NOW].as(); time_spec_t time_i = _mboard(m)[MBOARD_PROP_TIME_NOW].as(); if (time_i < time_0 or (time_i - time_0) > time_spec_t(0.01)){ //10 ms: greater than RTT but not too big - uhd::warning::post(str(boost::format( + UHD_MSG(warning) << boost::format( "Detected time deviation between board %d and board 0.\n" "Board 0 time is %f seconds.\n" "Board %d time is %f seconds.\n" - ) % m % time_0.get_real_secs() % m % time_i.get_real_secs())); + ) % m % time_0.get_real_secs() % m % time_i.get_real_secs(); } } } -- cgit v1.2.3