summaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2
diff options
context:
space:
mode:
authorPhilip Balister <philip@opensdr.com>2010-08-19 21:24:51 +0000
committerPhilip Balister <philip@opensdr.com>2010-08-19 21:24:51 +0000
commit10f6e1aeec082c6b5ef0485e232266921a3adbc7 (patch)
tree627e5f6391588b349bc14c47bfb10b1cf6c3f0ad /host/lib/usrp/usrp2
parent38722979512f0f6d57db9fd5e314b94cad1f188e (diff)
parentb84f2da152eb65afe89240941bd02d67b3582eae (diff)
downloaduhd-10f6e1aeec082c6b5ef0485e232266921a3adbc7.tar.gz
uhd-10f6e1aeec082c6b5ef0485e232266921a3adbc7.tar.bz2
uhd-10f6e1aeec082c6b5ef0485e232266921a3adbc7.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Conflicts: host/examples/CMakeLists.txt
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r--host/lib/usrp/usrp2/dsp_impl.cpp5
-rw-r--r--host/lib/usrp/usrp2/fw_common.h8
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp2
3 files changed, 8 insertions, 7 deletions
diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp
index 347ec38af..6422142ce 100644
--- a/host/lib/usrp/usrp2/dsp_impl.cpp
+++ b/host/lib/usrp/usrp2/dsp_impl.cpp
@@ -31,9 +31,10 @@ static const size_t default_interp = 16;
/***********************************************************************
* DDC Helper Methods
**********************************************************************/
-static unsigned pick_closest_rate(double exact_rate, const std::vector<unsigned> &rates){
+template <typename rate_type>
+static rate_type pick_closest_rate(double exact_rate, const std::vector<rate_type> &rates){
unsigned closest_match = rates.front();
- BOOST_FOREACH(unsigned possible_rate, rates){
+ BOOST_FOREACH(rate_type possible_rate, rates){
if(std::abs(exact_rate - possible_rate) < std::abs(exact_rate - closest_match))
closest_match = possible_rate;
}
diff --git a/host/lib/usrp/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h
index a781c1a21..cc6c41ba7 100644
--- a/host/lib/usrp/usrp2/fw_common.h
+++ b/host/lib/usrp/usrp2/fw_common.h
@@ -34,7 +34,7 @@ extern "C" {
//fpga and firmware compatibility numbers
#define USRP2_FPGA_COMPAT_NUM 1
-#define USRP2_FW_COMPAT_NUM 5
+#define USRP2_FW_COMPAT_NUM 6
//used to differentiate control packets over data port
#define USRP2_INVALID_VRT_HEADER 0
@@ -104,12 +104,12 @@ typedef struct{
union{
__stdint(uint32_t) ip_addr;
struct {
- __stdint(uint8_t) dev;
+ __stdint(uint32_t) dev;
+ __stdint(uint32_t) data;
__stdint(uint8_t) miso_edge;
__stdint(uint8_t) mosi_edge;
- __stdint(uint8_t) readback;
- __stdint(uint32_t) data;
__stdint(uint8_t) num_bits;
+ __stdint(uint8_t) readback;
} spi_args;
struct {
__stdint(uint8_t) addr;
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 4124221ef..2d450bfc6 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -115,7 +115,7 @@ public:
//setup the out data
usrp2_ctrl_data_t out_data;
out_data.id = htonl(USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO);
- out_data.data.spi_args.dev = which_slave;
+ out_data.data.spi_args.dev = htonl(which_slave);
out_data.data.spi_args.miso_edge = spi_edge_to_otw[config.miso_edge];
out_data.data.spi_args.mosi_edge = spi_edge_to_otw[config.mosi_edge];
out_data.data.spi_args.readback = (readback)? 1 : 0;