aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp1
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-07-03 17:40:13 -0700
committerJosh Blum <josh@joshknows.com>2011-07-03 17:40:13 -0700
commit34265334d18589a377ab42df211eb33054340ae6 (patch)
tree0efdf423fa95ed92ce2a9d77ddac6371d9256b83 /host/lib/usrp/usrp1
parent89989fdb2d92a6072b737a8864b50c9daa5c614a (diff)
downloaduhd-34265334d18589a377ab42df211eb33054340ae6.tar.gz
uhd-34265334d18589a377ab42df211eb33054340ae6.tar.bz2
uhd-34265334d18589a377ab42df211eb33054340ae6.zip
uhd: added inline message testing to the messages example
Renamed the example to test_messages (not just async). Fixed bug in super recv packet handler related to messages. Basically, the sequence number for messages should be ignored. Fixed some quirks with usrp1 soft time control to get it work as well.
Diffstat (limited to 'host/lib/usrp/usrp1')
-rw-r--r--host/lib/usrp/usrp1/soft_time_ctrl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp1/soft_time_ctrl.cpp b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
index cf602185d..2728ff755 100644
--- a/host/lib/usrp/usrp1/soft_time_ctrl.cpp
+++ b/host/lib/usrp/usrp1/soft_time_ctrl.cpp
@@ -93,6 +93,12 @@ public:
void recv_post(rx_metadata_t &md, size_t &nsamps){
boost::mutex::scoped_lock lock(_update_mutex);
+ //Since it timed out on the receive, check for inline messages...
+ //Must do a post check because recv() will not wake up for a message.
+ if (md.error_code == rx_metadata_t::ERROR_CODE_TIMEOUT){
+ if (_inline_msg_queue.pop_with_haste(md)) return;
+ }
+
//load the metadata with the expected time
md.has_time_spec = true;
md.time_spec = time_now();
@@ -114,7 +120,7 @@ public:
case stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE:
nsamps = _nsamps_remaining; //set nsamps, then stop
md.end_of_burst = true;
- stream_on_off(false);
+ this->issue_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
return;
default: break;
}
@@ -173,7 +179,8 @@ public:
metadata.time_spec = this->time_now();
metadata.error_code = rx_metadata_t::ERROR_CODE_LATE_COMMAND;
_inline_msg_queue.push_with_pop_on_full(metadata);
- _stream_mode = stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;
+ this->issue_stream_cmd(stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS);
+ return;
}
else{
sleep_until_time(lock, time_at);