diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-15 18:35:04 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-16 01:43:46 -0500 |
commit | 2e622ff131e06907f26f1eb1edd603e2f8ada118 (patch) | |
tree | d17de28028486f5e6c98735b905fa852a73afca5 | |
parent | 3f32ab5afa57221f08cfb865e64bb9543f573f20 (diff) |
Transceiver52M: Output device and operating mode to stdout
Very useful user information at startup.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 29 |
1 files 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; } /* |