aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRey Tucker <rey.tucker@nuand.com>2017-09-19 16:18:00 -0400
committerDimitri Stolnikov <horiz0n@gmx.net>2018-08-15 19:53:26 +0200
commitb4e69137f38aed3d359722afe79a5215a63998ef (patch)
treef57c288d90c7cda642b655049baf82703136b95b
parentbee32d9f0d9819db584282f25d9f575aaaf4ee61 (diff)
bladerf: use bladerf_get_channel_count where available
-rw-r--r--lib/bladerf/bladerf_common.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/bladerf/bladerf_common.cc b/lib/bladerf/bladerf_common.cc
index b8cc482..6711cf4 100644
--- a/lib/bladerf/bladerf_common.cc
+++ b/lib/bladerf/bladerf_common.cc
@@ -423,15 +423,11 @@ bladerf_board_type bladerf_common::get_board_type()
size_t bladerf_common::get_max_channels(bladerf_direction direction)
{
- if (BLADERF_RX == direction) {
- return _max_chans.find(get_board_type())->second.first;
- }
-
- if (BLADERF_TX == direction) {
- return _max_chans.find(get_board_type())->second.second;
- }
-
- return 0;
+#ifdef BLADERF_COMPATIBILITY
+ return 1;
+#else
+ return bladerf_get_channel_count(_dev.get(), (BLADERF_TX == direction));
+#endif
}
void bladerf_common::set_channel_enable(bladerf_channel ch, bool enable)