From 2e622ff131e06907f26f1eb1edd603e2f8ada118 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Fri, 15 Nov 2013 18:35:04 -0500 Subject: Transceiver52M: Output device and operating mode to stdout Very useful user information at startup. Signed-off-by: Thomas Tsou --- Transceiver52M/UHDDevice.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 56d48cc..6275cb2 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -90,6 +90,8 @@ static struct uhd_dev_offset special_offsets[] = { static double get_dev_offset(enum uhd_dev_type type, int sps, bool diversity = false) { + struct uhd_dev_offset *offset; + /* Reject USRP1 */ if (type == USRP1) { LOG(ERR) << "Invalid device type"; @@ -105,24 +107,27 @@ static double get_dev_offset(enum uhd_dev_type type, switch (sps) { case 1: - return special_offsets[0].offset; + offset = &special_offsets[0]; + break; case 4: default: - return special_offsets[1].offset; + offset = &special_offsets[1]; + } + } else { + /* Normal operation */ + switch (sps) { + case 1: + offset = &uhd_offsets[2 * type + 0]; + break; + case 4: + default: + offset = &uhd_offsets[2 * type + 1]; } } - /* Normal operation */ - switch (sps) { - case 1: - return uhd_offsets[2 * type + 0].offset; - case 4: - default: - return uhd_offsets[2 * type + 1].offset; - } + std::cout << "-- Setting " << offset->desc << std::endl; - LOG(ERR) << "Unsupported samples-per-symbols: " << sps; - return 0.0; + return offset->offset; } /* -- cgit v1.2.3