diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-06-06 16:51:53 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-06-06 16:51:53 -0700 |
commit | c69222a15c36c7222805a9b64f786ee5d6fbfb3e (patch) | |
tree | e01b242f30ea297d6b14d2416226e5defd19f9ba /host | |
parent | b1c2d4bbb4e1ae3b085bb0ca84b2f53ce8bbd357 (diff) | |
parent | 2004bbdb0298d7a2ce9aa274e4a9bbdd22792567 (diff) | |
download | uhd-c69222a15c36c7222805a9b64f786ee5d6fbfb3e.tar.gz uhd-c69222a15c36c7222805a9b64f786ee5d6fbfb3e.tar.bz2 uhd-c69222a15c36c7222805a9b64f786ee5d6fbfb3e.zip |
Merge branch 'maint'
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp_clock/octoclock/common.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/host/lib/usrp_clock/octoclock/common.h b/host/lib/usrp_clock/octoclock/common.h index 5861bc4b1..89fec9ce5 100644 --- a/host/lib/usrp_clock/octoclock/common.h +++ b/host/lib/usrp_clock/octoclock/common.h @@ -25,14 +25,16 @@ */ #ifdef __cplusplus -#define UHD_OCTOCLOCK_SEND_AND_RECV(xport, pkt_code, pkt_out, len, data) pkt_out.proto_ver = OCTOCLOCK_FW_COMPAT_NUM; \ - pkt_out.code = pkt_code; \ - xport->send(boost::asio::buffer(&pkt_out, sizeof(octoclock_packet_t))); \ - len = xport->recv(boost::asio::buffer(data), 2); - -#define UHD_OCTOCLOCK_PACKET_MATCHES(pkt_code, pkt_out, pkt_in, len) (len > offsetof(octoclock_packet_t, data) and \ - pkt_in->sequence == pkt_out.sequence and \ - pkt_in->code == pkt_code) +#define UHD_OCTOCLOCK_SEND_AND_RECV(xport, pkt_code, pkt_out, len, data) do {\ + pkt_out.proto_ver = OCTOCLOCK_FW_COMPAT_NUM; \ + pkt_out.code = pkt_code; \ + xport->send(boost::asio::buffer(&pkt_out, sizeof(octoclock_packet_t))); \ + len = xport->recv(boost::asio::buffer(data), 2);\ + } while(0) + +#define UHD_OCTOCLOCK_PACKET_MATCHES(pkt_code, pkt_out, pkt_in, len) (len > offsetof(octoclock_packet_t, data) and \ + pkt_in->sequence == pkt_out.sequence and \ + pkt_in->code == pkt_code) extern "C" { #endif |