From da99b7edc2d1cfedd9c8acf36630d799782ee455 Mon Sep 17 00:00:00 2001 From: Balint Seeber Date: Wed, 19 Mar 2014 16:19:46 -0700 Subject: b200: changed ad9361 ctrl/transaction magic number 64 to macro, as it is in the FX3 FW --- host/lib/usrp/common/ad9361_ctrl.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp/common/ad9361_ctrl.hpp') diff --git a/host/lib/usrp/common/ad9361_ctrl.hpp b/host/lib/usrp/common/ad9361_ctrl.hpp index 7a13d1439..098b5dae8 100644 --- a/host/lib/usrp/common/ad9361_ctrl.hpp +++ b/host/lib/usrp/common/ad9361_ctrl.hpp @@ -27,6 +27,8 @@ #include #include +#include "ad9361_transaction.h" + static const double AD9361_CLOCK_RATE_MAX = 61.44e6; static const double AD9361_1_CHAN_CLOCK_RATE_MAX = AD9361_CLOCK_RATE_MAX; @@ -35,7 +37,7 @@ static const double AD9361_2_CHAN_CLOCK_RATE_MAX = (AD9361_1_CHAN_CLOCK_RATE_MAX struct ad9361_ctrl_iface_type { - virtual void ad9361_transact(const unsigned char in_buff[64], unsigned char out_buff[64]) = 0; + virtual void ad9361_transact(const unsigned char in_buff[AD9361_DISPATCH_PACKET_SIZE], unsigned char out_buff[AD9361_DISPATCH_PACKET_SIZE]) = 0; }; typedef boost::shared_ptr ad9361_ctrl_iface_sptr; @@ -47,18 +49,18 @@ struct ad9361_ctrl_over_zc : ad9361_ctrl_iface_type _xport = xport; } - void ad9361_transact(const unsigned char in_buff[64], unsigned char out_buff[64]) + void ad9361_transact(const unsigned char in_buff[AD9361_DISPATCH_PACKET_SIZE], unsigned char out_buff[AD9361_DISPATCH_PACKET_SIZE]) { { uhd::transport::managed_send_buffer::sptr buff = _xport->get_send_buff(10.0); - if (not buff or buff->size() < 64) throw std::runtime_error("ad9361_ctrl_over_zc send timeout"); - std::memcpy(buff->cast(), in_buff, 64); - buff->commit(64); + if (not buff or buff->size() < AD9361_DISPATCH_PACKET_SIZE) throw std::runtime_error("ad9361_ctrl_over_zc send timeout"); + std::memcpy(buff->cast(), in_buff, AD9361_DISPATCH_PACKET_SIZE); + buff->commit(AD9361_DISPATCH_PACKET_SIZE); } { uhd::transport::managed_recv_buffer::sptr buff = _xport->get_recv_buff(10.0); - if (not buff or buff->size() < 64) throw std::runtime_error("ad9361_ctrl_over_zc recv timeout"); - std::memcpy(out_buff, buff->cast(), 64); + if (not buff or buff->size() < AD9361_DISPATCH_PACKET_SIZE) throw std::runtime_error("ad9361_ctrl_over_zc recv timeout"); + std::memcpy(out_buff, buff->cast(), AD9361_DISPATCH_PACKET_SIZE); } } -- cgit v1.2.3